Fix get_free_username tests

This commit is contained in:
Martin Pépin 2021-01-21 22:11:41 +01:00
parent 0b54b16350
commit b8acee8d30
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -16,11 +16,11 @@ class TestCASBackend(TestCase):
UserModel.objects.create(username="toto2")
backend = ENSCASBackend()
for _ in range(10):
username = backend.get_free_username("toto")
username = backend.get_free_username("toto", None)
self.assertFalse(UserModel.objects.filter(username=username).exists())
UserModel.objects.create(username=username)
for _ in range(10):
username = backend.get_free_username("tutu")
username = backend.get_free_username("tutu", None)
self.assertFalse(UserModel.objects.filter(username=username).exists())
UserModel.objects.create(username=username)