Test the login switch view

This commit is contained in:
Martin Pépin 2020-05-17 21:37:04 +02:00
parent 68e43f488a
commit 9f2e2a235a
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -13,7 +13,7 @@ from authens.tests.cas_utils import FakeCASClient
UserModel = get_user_model() UserModel = get_user_model()
class TestCASLoginView(TestCase): class TestLoginViews(TestCase):
def test_cas_login_redirect(self): def test_cas_login_redirect(self):
url = reverse("authens:login.cas") url = reverse("authens:login.cas")
abs_url = "http://testserver{}".format(url) abs_url = "http://testserver{}".format(url)
@ -40,6 +40,10 @@ class TestCASLoginView(TestCase):
response = client.get("{}?ticket=dummy-ticket".format(url), follow=True) response = client.get("{}?ticket=dummy-ticket".format(url), follow=True)
self.assertRedirects(response, settings.LOGIN_REDIRECT_URL) 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): class TestLogoutView(TestCase):
def test_regular_logout(self): def test_regular_logout(self):