Skip to content

Commit e84020e

Browse files
committed
fix tests
1 parent f91dc4a commit e84020e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Diff for: authentication/pipeline/user.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_username(strategy, backend, user=None, *args, **kwargs): # pylint: disa
6363
return {"username": None if not user else strategy.storage.user.get_username(user)}
6464

6565

66-
def limit_one_auth_per_backend(strategy, backend, user, uid, **kwargs): # pylint: disable=unused-argument
66+
def limit_one_auth_per_backend(strategy, backend, user, uid, **kwargs): # pylint: disable=unused-argument # noqa: ARG001
6767
"""
6868
Limit the user to one social auth account per backend
6969
@@ -76,7 +76,6 @@ def limit_one_auth_per_backend(strategy, backend, user, uid, **kwargs): # pylin
7676
if not user:
7777
return {}
7878

79-
user_storage = strategy.storage.user
8079
social_auths = UserSocialAuth.objects.filter(user=user, provider=backend.name)
8180

8281
# if there's at least one social auth and any of them don't match the incoming uid

Diff for: authentication/pipeline/user_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def test_limit_one_auth_per_backend_conflicting_auth(mocker, user):
560560
mock_backend.name = "email"
561561
UserSocialAuthFactory.create(user=user, provider=mock_backend.name)
562562

563-
assert UserSocialAuth.filter(user=user, provider=mock_backend.name).count() == 1
563+
assert UserSocialAuth.objects.filter(user=user, provider=mock_backend.name).count() == 1
564564

565565
with pytest.raises(AuthException):
566566
user_actions.limit_one_auth_per_backend(backend=mock_backend, user=user, strategy=mock_strategy, uid="non-matching")

0 commit comments

Comments
 (0)