Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fixed #19792 -- Remove test client is_active check #718

Closed
wants to merge 1 commit into from

2 participants

Nick Sandford Tim Graham
Nick Sandford

Thanks mrmagooey for the report.

Tim Graham
Owner

Ticket has been marked as "won't fix."

Tim Graham timgraham closed this May 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Feb 12, 2013
Nick Sandford Fixed #19792 -- Remove test client is_active check b93645b
This page is out of date. Refresh to see the latest.
3  django/test/client.py
@@ -532,8 +532,7 @@ def login(self, **credentials):
532 532
         not available.
533 533
         """
534 534
         user = authenticate(**credentials)
535  
-        if user and user.is_active \
536  
-                and 'django.contrib.sessions' in settings.INSTALLED_APPS:
  535
+        if user and 'django.contrib.sessions' in settings.INSTALLED_APPS:
537 536
             engine = import_module(settings.SESSION_ENGINE)
538 537
 
539 538
             # Create a fake request to store login details.
8  tests/regressiontests/test_client_regress/tests.py
@@ -551,6 +551,14 @@ def test_login_different_client(self):
551 551
         # default client.
552 552
         self.assertRedirects(response, "http://testserver/test_client_regress/get_view/")
553 553
 
  554
+    def test_login_with_inactive_user(self):
  555
+        """
  556
+        Test that logging in with an inactive user works.
  557
+        Refs #19792.
  558
+        """
  559
+        login = self.client.login(username='inactive', password='password')
  560
+        self.assertTrue(login, 'Could not log in')
  561
+
554 562
 
555 563
 @override_settings(
556 564
     PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.