summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlin-hua-cheng <os.lcheng@gmail.com>2015-04-03 21:17:23 -0700
committerlin-hua-cheng <os.lcheng@gmail.com>2015-04-03 21:18:28 -0700
commit607b78ef0e93ceaac9e7b83ccecf26ba694a521b (patch)
treee916fb7f208c685518d744e6642e319cb2fb9c13
parent6048c673c74be313aeb3d32b49d49098ca6e1957 (diff)
downloaddjango_openstack_auth-607b78ef0e93ceaac9e7b83ccecf26ba694a521b.tar.gz
Add websso redirect test
Change-Id: I38748fcf97c3aa4ed51ae0310f37405431629851
-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