MCPcopy
hub / github.com/django/django / _alogin

Method _alogin

django/test/client.py:889–904  ·  view source on GitHub ↗
(self, user, backend=None)

Source from the content-addressed store, hash-verified

887 self._set_login_cookies(request)
888
889 async def _alogin(self, user, backend=None):
890 from django.contrib.auth import alogin
891
892 # Create a fake request to store login details.
893 request = HttpRequest()
894 session = await self.asession()
895 if session:
896 request.session = session
897 else:
898 engine = import_module(settings.SESSION_ENGINE)
899 request.session = engine.SessionStore()
900
901 await alogin(request, user, backend)
902 # Save the session values.
903 await request.session.asave()
904 self._set_login_cookies(request)
905
906 def _set_login_cookies(self, request):
907 # Set the cookie to represent the session.

Callers 2

aloginMethod · 0.95
aforce_loginMethod · 0.95

Calls 5

asessionMethod · 0.95
_set_login_cookiesMethod · 0.95
HttpRequestClass · 0.90
aloginFunction · 0.90
asaveMethod · 0.45

Tested by

no test coverage detected