Skip to content

Commit

Permalink
feat: Upgrade django-allauth
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Apr 25, 2024
1 parent 8f83b41 commit 0a20236
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 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
2 changes: 1 addition & 1 deletion dj_rest_auth/tests/requirements.pip
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coveralls==1.11.1
django-allauth==0.61.1
django-allauth[socialaccount]==0.62.1
djangorestframework-simplejwt>=5.3.1
flake8==3.8.4
responses==0.12.1
Expand Down
5 changes: 3 additions & 2 deletions dj_rest_auth/tests/test_serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from allauth.socialaccount.providers.facebook.views import FacebookProvider
from allauth.socialaccount.providers.facebook.provider import FacebookProvider
from allauth.socialaccount.models import SocialApp
from allauth.core.exceptions import ImmediateHttpResponse
from django.contrib.auth import get_user_model
Expand Down Expand Up @@ -119,6 +119,7 @@ class TestSocialLoginSerializer(TestCase):
def setUpTestData(cls):
cls.request_data = {"access_token": "token1234"}
cls.request = APIRequestFactory().post(cls.request_data, format='json')
cls.request.session = {}
social_app = SocialApp.objects.create(
provider='facebook',
name='Facebook',
Expand Down Expand Up @@ -148,7 +149,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.fb_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 0a20236

Please sign in to comment.