From abf0200f87755ba21de1b50462ac3b3cfb36bfb2 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Tue, 5 Jul 2016 13:09:52 +0200 Subject: [PATCH] Add a test case related to 6b3b280d316574394cf99a783e13ec7dcba6765e --- cas_server/tests/test_federate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cas_server/tests/test_federate.py b/cas_server/tests/test_federate.py index a33feed..3731dc5 100644 --- a/cas_server/tests/test_federate.py +++ b/cas_server/tests/test_federate.py @@ -151,7 +151,14 @@ class FederateAuthLoginLogoutTestCase( def test_login_twice(self): """Test that user id db is used for the second login (cf coverage)""" 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) def test_auth_federate_false(self):