Skip to content

Commit

Permalink
tests: It is deprecated to return a value that is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Sep 20, 2024
1 parent 7080853 commit 00f313a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions allauth/socialaccount/providers/flickr/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.tests import OAuthTestsMixin
from allauth.tests import MockedResponse, TestCase

Expand Down Expand Up @@ -47,7 +48,8 @@ def get_expected_to_str(self):
return "pennersr"

def test_login(self):
account = super(FlickrTests, self).test_login()
super().test_login()
account = SocialAccount.objects.get(uid="12345678@N00")
f_account = account.get_provider_account()
self.assertEqual(account.user.first_name, "raymond")
self.assertEqual(account.user.last_name, "penners")
Expand Down Expand Up @@ -103,7 +105,8 @@ def get_expected_to_str(self):
return "pennersr"

def test_login(self):
account = super(FlickrWithoutRealNameTests, self).test_login()
super().test_login()
account = SocialAccount.objects.get(uid="12345678@N00")
f_account = account.get_provider_account()
self.assertEqual(account.user.first_name, "")
self.assertEqual(account.user.last_name, "")
Expand Down
4 changes: 3 additions & 1 deletion allauth/socialaccount/providers/openstreetmap/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.tests import OAuthTestsMixin
from allauth.tests import MockedResponse, TestCase

Expand Down Expand Up @@ -34,7 +35,8 @@ def get_expected_to_str(self):
return "Steve"

def test_login(self):
account = super(OpenStreetMapTests, self).test_login()
super().test_login()
account = SocialAccount.objects.get(uid="1")
osm_account = account.get_provider_account()
self.assertEqual(osm_account.get_username(), "Steve")
self.assertEqual(
Expand Down
4 changes: 3 additions & 1 deletion allauth/socialaccount/providers/twitter/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.tests import OAuthTestsMixin
from allauth.tests import MockedResponse, TestCase

Expand Down Expand Up @@ -31,7 +32,8 @@ def get_expected_to_str(self):
return "pennersr"

def test_login(self):
account = super(TwitterTests, self).test_login()
super().test_login()
account = SocialAccount.objects.get(uid="45671919")
tw_account = account.get_provider_account()
self.assertEqual(tw_account.get_screen_name(), "pennersr")
self.assertEqual(
Expand Down
1 change: 0 additions & 1 deletion allauth/socialaccount/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def test_login(self):
provider_account.get_avatar_url()
provider_account.get_profile_url()
provider_account.get_brand()
return account

@override_settings(
SOCIALACCOUNT_AUTO_SIGNUP=True,
Expand Down

0 comments on commit 00f313a

Please sign in to comment.