8
8
from django .db import IntegrityError
9
9
from rest_framework import status
10
10
from social_core .backends .email import EmailAuth
11
- from social_django .utils import load_backend , load_strategy
12
11
from social_core .exceptions import AuthException
13
12
from social_django .models import UserSocialAuth
14
-
15
-
13
+ from social_django .utils import load_backend , load_strategy
16
14
17
15
from authentication .exceptions import (
18
16
EmailBlockedException ,
@@ -550,7 +548,13 @@ def test_limit_one_auth_per_backend_no_user(mocker):
550
548
"""limit_one_auth_per_backend should not error if the user doesn't exist"""
551
549
mock_strategy = mocker .Mock ()
552
550
mock_backend = mocker .Mock ()
553
- assert user_actions .limit_one_auth_per_backend (strategy = mock_strategy , backend = mock_backend , user = None , uid = None ) == {}
551
+ assert (
552
+ user_actions .limit_one_auth_per_backend (
553
+ strategy = mock_strategy , backend = mock_backend , user = None , uid = None
554
+ )
555
+ == {}
556
+ )
557
+
554
558
555
559
@pytest .mark .django_db
556
560
def test_limit_one_auth_per_backend_conflicting_auth (mocker , user ):
@@ -560,7 +564,12 @@ def test_limit_one_auth_per_backend_conflicting_auth(mocker, user):
560
564
mock_backend .name = "email"
561
565
UserSocialAuthFactory .create (user = user , provider = mock_backend .name )
562
566
563
- assert UserSocialAuth .objects .filter (user = user , provider = mock_backend .name ).count () == 1
567
+ assert (
568
+ UserSocialAuth .objects .filter (user = user , provider = mock_backend .name ).count ()
569
+ == 1
570
+ )
564
571
565
572
with pytest .raises (AuthException ):
566
- user_actions .limit_one_auth_per_backend (backend = mock_backend , user = user , strategy = mock_strategy , uid = "non-matching" )
573
+ user_actions .limit_one_auth_per_backend (
574
+ backend = mock_backend , user = user , strategy = mock_strategy , uid = "non-matching"
575
+ )
0 commit comments