MCPcopy
hub / github.com/django/django / login

Method login

django/test/client.py:829–842  ·  view source on GitHub ↗

Set the Factory to appear as if it has successfully logged into a site. Return True if login is possible or False if the provided credentials are incorrect.

(self, **credentials)

Source from the content-addressed store, hash-verified

827 return session
828
829 def login(self, **credentials):
830 """
831 Set the Factory to appear as if it has successfully logged into a site.
832
833 Return True if login is possible or False if the provided credentials
834 are incorrect.
835 """
836 from django.contrib.auth import authenticate
837
838 user = authenticate(**credentials)
839 if user:
840 self._login(user)
841 return True
842 return False
843
844 async def alogin(self, **credentials):
845 """See login()."""

Callers

nothing calls this directly

Calls 2

_loginMethod · 0.95
authenticateFunction · 0.90

Tested by

no test coverage detected