Skip to content

Commit db8178f

Browse files
committed
✅(backend) fix test_backend authentication test suite
The last version of django-lasuite introduces a modification on the query made. We have to update the tests because there is one more sql query made.
1 parent 5b5cbf4 commit db8178f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/core/tests/authentication/test_backends.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_userinfo_mocked(*args):
5757

5858
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
5959

60-
with django_assert_num_queries(3): # user by sub, user by mail, update sub
60+
with django_assert_num_queries(4): # user by sub, user by mail, update sub
6161
user = klass.get_or_create_user(
6262
access_token="test-token", id_token=None, payload=None
6363
)
@@ -214,7 +214,7 @@ def get_userinfo_mocked(*args):
214214
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
215215

216216
# One and only one additional update query when a field has changed
217-
with django_assert_num_queries(2):
217+
with django_assert_num_queries(3):
218218
authenticated_user = klass.get_or_create_user(
219219
access_token="test-token", id_token=None, payload=None
220220
)
@@ -256,7 +256,7 @@ def get_userinfo_mocked(*args):
256256
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
257257

258258
# One and only one additional update query when a field has changed
259-
with django_assert_num_queries(3):
259+
with django_assert_num_queries(4):
260260
authenticated_user = klass.get_or_create_user(
261261
access_token="test-token", id_token=None, payload=None
262262
)

0 commit comments

Comments
 (0)