Add websso redirect test

Change-Id: I38748fcf97c3aa4ed51ae0310f37405431629851
This commit is contained in:
lin-hua-cheng 2015-04-03 21:17:23 -07:00
parent 6048c673c7
commit 607b78ef0e
1 changed files with 16 additions and 1 deletions

View File

@ -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