From 9f2e2a235a2641ff12131f2aa1dafb2f02f81c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 17 May 2020 21:37:04 +0200 Subject: [PATCH] Test the login switch view --- authens/tests/test_views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/authens/tests/test_views.py b/authens/tests/test_views.py index e3ab8d6..5275fb3 100644 --- a/authens/tests/test_views.py +++ b/authens/tests/test_views.py @@ -13,7 +13,7 @@ from authens.tests.cas_utils import FakeCASClient UserModel = get_user_model() -class TestCASLoginView(TestCase): +class TestLoginViews(TestCase): def test_cas_login_redirect(self): url = reverse("authens:login.cas") abs_url = "http://testserver{}".format(url) @@ -40,6 +40,10 @@ class TestCASLoginView(TestCase): response = client.get("{}?ticket=dummy-ticket".format(url), follow=True) self.assertRedirects(response, settings.LOGIN_REDIRECT_URL) + def test_can_gen_login_switch(self): + response = Client().get(reverse("authens:login")) + self.assertEqual(response.status_code, 200) + class TestLogoutView(TestCase): def test_regular_logout(self):