summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-06-16 12:46:23 -0400
committerTim Graham <timograham@gmail.com>2015-06-16 12:47:27 -0400
commit8050e6282e4daee24758a4a1c6c2fa938957bef2 (patch)
tree5664fd4ced5d94d6d9b81d53616de25ba7754f19
parent0e3a80fa683bcc8c6ea4036ad81b6b882234e795 (diff)
[1.8.x] Refs #24987 -- Documented that Client.login() rejects inactive users.
Backport of fbc618c13cc72b9c2f4c8dfd5ef8b8ab5a5d7caa from master
-rw-r--r--docs/topics/testing/tools.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index d0b63e79ab..4c3b359923 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -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
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
and session data required to pass any login-based tests that may form
part of a view.