Skip to content

Commit

Permalink
feat: Upgrade django-allauth
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr authored and gekoke committed Apr 29, 2024
1 parent cfaa9f6 commit 3342e05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dj_rest_auth/registration/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def validate(self, attrs):
)

provider = adapter.get_provider()
scope = provider.get_scope(request)
scope = provider.get_scope_from_request(request)
client = self.client_class(
request,
app.client_id,
Expand Down
7 changes: 2 additions & 5 deletions dj_rest_auth/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ class TestSocialLoginSerializer(TestCase):
def setUpTestData(cls):
cls.request_data = {"access_token": "token1234"}
cls.request = APIRequestFactory().post(cls.request_data, format='json')

middleware = SessionMiddleware(get_response=MagicMock())
middleware(cls.request)

cls.request.session = {}
social_app = SocialApp.objects.create(
provider='facebook',
name='Facebook',
Expand Down Expand Up @@ -153,7 +150,7 @@ def test_validate_no_adpapter_class_present(self):
serializer.is_valid()
self.assertDictEqual(serializer.errors, self.NO_ADAPTER_CLASS_PRESENT)

@patch('allauth.socialaccount.providers.facebook.views.FacebookOAuth2Adapter.complete_login')
@patch('allauth.socialaccount.providers.facebook.flows.complete_login')
@patch('allauth.socialaccount.adapter.DefaultSocialAccountAdapter.pre_social_login')
def test_immediate_http_response_error(self, mock_pre_social_login, mock_fb_complete_login):
dummy_view = SocialLoginView()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'djangorestframework>=3.13.0',
],
extras_require={
'with_social': ['django-allauth>=0.56.0,<0.62.0'],
'with_social': ['django-allauth[socialaccount]>=0.62.0,<=0.62.1'],
},
tests_require=[
'coveralls>=1.11.1',
Expand Down

0 comments on commit 3342e05

Please sign in to comment.