Add a test case related to 6b3b280d31

This commit is contained in:
Valentin Samir 2016-07-05 13:09:52 +02:00
parent 17228baec7
commit abf0200f87

View File

@ -151,7 +151,14 @@ class FederateAuthLoginLogoutTestCase(
def test_login_twice(self): def test_login_twice(self):
"""Test that user id db is used for the second login (cf coverage)""" """Test that user id db is used for the second login (cf coverage)"""
self.test_login_post_provider() self.test_login_post_provider()
self.test_login_post_provider() tickets = self.test_login_post_provider()
# trying to authenticated while being already authenticated should redirect to /login
for (provider, _, client) in tickets:
response = client.get("/federate/%s" % provider.suffix)
self.assertEqual(response.status_code, 302)
self.assertEqual(response["Location"], "%s/login" % (
'http://testserver' if django.VERSION < (1, 9) else ""
))
@override_settings(CAS_FEDERATE=False) @override_settings(CAS_FEDERATE=False)
def test_auth_federate_false(self): def test_auth_federate_false(self):