diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-12 15:26:37 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-12 15:26:37 +0000 |
| commit | b8d0dc73c762bedc0a36bb380cded62a7b3ea162 (patch) | |
| tree | 99466bf5a884ee384e3efa57e28f6880481dd07b /django | |
| parent | b9232cd955496b69444ca458fa2ba45ab9e25c34 (diff) | |
Fixed #4526 -- Modified the test Client login method to fail when a user is inactive. Thanks, marcin@elksoft.pl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/client.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/test/client.py b/django/test/client.py index ed72ad8f77..b43b3910be 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -225,10 +225,11 @@ class Client: """Set the Client to appear as if it has sucessfully logged into a site. Returns True if login is possible; False if the provided credentials - are incorrect, or if the Sessions framework is not available. + are incorrect, or the user is inactive, or if the Sessions framework is + not available. """ user = authenticate(**credentials) - if user and 'django.contrib.sessions' in settings.INSTALLED_APPS: + if user and user.is_active and 'django.contrib.sessions' in settings.INSTALLED_APPS: obj = Session.objects.get_new_session_object() # Create a fake request to store login details |
