forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #28751 -- Corrected the error message for inactive users in Adm…
…inAuthenticationForm. Thanks SeungWon Kang for the report and Tim Graham for the review.
- Loading branch information
1 parent
359370a
commit ebb9989
Showing
2 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.contrib.admin.forms import AdminAuthenticationForm | ||
from django.contrib.auth.models import User | ||
from django.test import TestCase | ||
|
||
|
||
class AdminAuthenticationFormTests(TestCase): | ||
@classmethod | ||
def setUpTestData(cls): | ||
User.objects.create_user(username='inactive', password='password', is_active=False) | ||
|
||
def test_inactive_user(self): | ||
data = { | ||
'username': 'inactive', | ||
'password': 'password', | ||
} | ||
form = AdminAuthenticationForm(None, data) | ||
self.assertEqual(form.non_field_errors(), ['This account is inactive.']) |