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)
| 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().""" |
nothing calls this directly
no test coverage detected