diff options
author | lin-hua-cheng <os.lcheng@gmail.com> | 2015-04-03 21:17:23 -0700 |
---|---|---|
committer | lin-hua-cheng <os.lcheng@gmail.com> | 2015-04-03 21:18:28 -0700 |
commit | 607b78ef0e93ceaac9e7b83ccecf26ba694a521b (patch) | |
tree | e916fb7f208c685518d744e6642e319cb2fb9c13 | |
parent | 6048c673c74be313aeb3d32b49d49098ca6e1957 (diff) | |
download | django_openstack_auth-607b78ef0e93ceaac9e7b83ccecf26ba694a521b.tar.gz |
Add websso redirect test
Change-Id: I38748fcf97c3aa4ed51ae0310f37405431629851
-rw-r--r-- | openstack_auth/tests/tests.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/openstack_auth/tests/tests.py b/openstack_auth/tests/tests.py index 76e6519..29bfa3d 100644 --- a/openstack_auth/tests/tests.py +++ b/openstack_auth/tests/tests.py @@ -857,7 +857,22 @@ class OpenStackAuthTestsWebSSO(OpenStackAuthTestsMixin, test.TestCase): self.assertContains(response, 'oidc') self.assertContains(response, 'saml2') - def test_web_sso_login(self): + def test_websso_redirect(self): + origin = 'http://testserver/auth/websso/' + protocol = 'oidc' + redirect_url = ('%s/auth/OS-FEDERATION/websso/%s?origin=%s' % + (settings.OPENSTACK_KEYSTONE_URL, protocol, origin)) + + form_data = {'auth_type': protocol, + 'region': settings.OPENSTACK_KEYSTONE_URL} + url = reverse('login') + + # POST to the page and redirect to keystone. + response = self.client.post(url, form_data) + self.assertRedirects(response, redirect_url, status_code=302, + target_status_code=404) + + def test_websso_login(self): projects = [self.data.project_one, self.data.project_two] unscoped = self.data.federated_unscoped_access_info token = unscoped.auth_token |