From 607b78ef0e93ceaac9e7b83ccecf26ba694a521b Mon Sep 17 00:00:00 2001 From: lin-hua-cheng Date: Fri, 3 Apr 2015 21:17:23 -0700 Subject: [PATCH] Add websso redirect test Change-Id: I38748fcf97c3aa4ed51ae0310f37405431629851 --- openstack_auth/tests/tests.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/openstack_auth/tests/tests.py b/openstack_auth/tests/tests.py index 76e6519b..29bfa3d5 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