Skip to content

Commit

Permalink
tests: Add request context
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Aug 22, 2024
1 parent e9fc0d7 commit 40433ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion allauth/account/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
validate_password,
)
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import FieldDoesNotExist, PermissionDenied
from django.core.exceptions import FieldDoesNotExist
from django.core.mail import EmailMessage, EmailMultiAlternatives
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import resolve_url
Expand Down
13 changes: 7 additions & 6 deletions allauth/socialaccount/tests/test_signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ def f(client, sociallogin):
request = request_factory.get("/")
request.user = AnonymousUser()

resp = complete_social_login(request, sociallogin)
session = client.session
for k, v in request.session.items():
session[k] = v
session.save()
return resp
with context.request_context(request):
resp = complete_social_login(request, sociallogin)
session = client.session
for k, v in request.session.items():
session[k] = v
session.save()
return resp

return f

Expand Down

0 comments on commit 40433ea

Please sign in to comment.