From fbc618c13cc72b9c2f4c8dfd5ef8b8ab5a5d7caa Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 16 Jun 2015 12:46:23 -0400 Subject: [PATCH] Refs #24987 -- Documented that Client.login() rejects inactive users. --- docs/topics/testing/tools.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 7aaeff97af..2ebe98eda4 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -340,6 +340,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 + `) 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.