On rajoute un test pour l'auth OldCAS avec un compte CAS non migré

This commit is contained in:
Tom Hubrecht 2021-01-23 11:07:21 +01:00
parent d9490ba34a
commit 4dbd0a1a80

View file

@ -123,3 +123,12 @@ class TestOldCASBackend(TestCase):
None, cas_login="johndoe", entrance_year=2014, password="password"
)
self.assertEqual(auth_user, user)
def test_not_migrated_auth(self):
user = UserModel.objects.create_user(username="vieilleux", password="password")
CASAccount.objects.create(user=user, cas_login="vieilleux", entrance_year=2015)
auth_user = authenticate(
None, cas_login="vieilleux", entrance_year=2015, password="password"
)
self.assertEqual(auth_user, user)