summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-04-07 20:03:27 +0000
committerGerrit Code Review <review@openstack.org>2015-04-07 20:03:27 +0000
commit8385556187a8f4b6b15875324fc7b538da1ec37c (patch)
tree39dd8da7124103070ef5999215f76b03d0bc8dde
parent09611a3d3ce1191d5c3084200e1c27db34b7c3e4 (diff)
parent607b78ef0e93ceaac9e7b83ccecf26ba694a521b (diff)
downloaddjango_openstack_auth-8385556187a8f4b6b15875324fc7b538da1ec37c.tar.gz
Merge "Add websso redirect test"
-rw-r--r--openstack_auth/tests/tests.py17
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