[1.8.x] Refs #24987 -- Documented that Client.login() rejects inactive users.

Backport of fbc618c13c from master
This commit is contained in:
Tim Graham 2015-06-16 12:46:23 -04:00
parent 0e3a80fa68
commit 8050e6282e
1 changed files with 7 additions and 0 deletions

View File

@ -344,6 +344,13 @@ Use the ``django.test.Client`` class to make requests.
``login()`` method to simulate the effect of a user logging into the ``login()`` method to simulate the effect of a user logging into the
site. site.
Inactive users (:attr:`is_active=False
<django.contrib.auth.models.User.is_active>`) are not permitted to
login as this method is meant to be equivalent to the
:func:`~django.contrib.auth.login` view which uses
:class:`~django.contrib.auth.forms.AuthenticationForm` and therefore
defaults to rejecting users who are inactive.
After you call this method, the test client will have all the cookies After you call this method, the test client will have all the cookies
and session data required to pass any login-based tests that may form and session data required to pass any login-based tests that may form
part of a view. part of a view.