diff --git a/django/contrib/admin/forms.py b/django/contrib/admin/forms.py
index f26c100..e790e2e 100644
a
|
b
|
from django.contrib.auth.models import User
|
6 | 6 | |
7 | 7 | from django.utils.translation import ugettext_lazy, ugettext as _ |
8 | 8 | |
9 | | ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. " |
10 | | "Note that both fields are case-sensitive.") |
| 9 | ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password " |
| 10 | "for a staff account. Note that both fields are case-sensitive.") |
11 | 11 | |
12 | 12 | class AdminAuthenticationForm(AuthenticationForm): |
13 | 13 | """ |
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 22b65a6..291b050 100644
a
|
b
|
from django.core.urlresolvers import reverse
|
14 | 14 | from django.contrib.auth import REDIRECT_FIELD_NAME, admin |
15 | 15 | from django.contrib.auth.models import Group, User, Permission, UNUSABLE_PASSWORD |
16 | 16 | from django.contrib.contenttypes.models import ContentType |
| 17 | from django.contrib.admin.forms import ERROR_MESSAGE |
17 | 18 | from django.contrib.admin.models import LogEntry, DELETION |
18 | 19 | from django.contrib.admin.sites import LOGIN_FORM_KEY |
19 | 20 | from django.contrib.admin.util import quote |
… |
… |
class AdminViewPermissionsTest(TestCase):
|
754 | 755 | self.assertContains(login, "Your e-mail address is not your username") |
755 | 756 | # only correct passwords get a username hint |
756 | 757 | login = self.client.post('/test_admin/admin/', self.super_email_bad_login) |
757 | | self.assertContains(login, "Please enter a correct username and password.") |
| 758 | self.assertContains(login, ERROR_MESSAGE) |
758 | 759 | new_user = User(username='jondoe', password='secret', email='super@example.com') |
759 | 760 | new_user.save() |
760 | 761 | # check to ensure if there are multiple e-mail addresses a user doesn't get a 500 |
761 | 762 | login = self.client.post('/test_admin/admin/', self.super_email_login) |
762 | | self.assertContains(login, "Please enter a correct username and password.") |
| 763 | self.assertContains(login, ERROR_MESSAGE) |
763 | 764 | |
764 | 765 | # Add User |
765 | 766 | request = self.client.get('/test_admin/admin/') |
… |
… |
class AdminViewPermissionsTest(TestCase):
|
790 | 791 | self.assertEqual(request.status_code, 200) |
791 | 792 | login = self.client.post('/test_admin/admin/', self.joepublic_login) |
792 | 793 | self.assertEqual(login.status_code, 200) |
793 | | self.assertContains(login, "Please enter a correct username and password.") |
| 794 | self.assertContains(login, ERROR_MESSAGE) |
794 | 795 | |
795 | 796 | # Requests without username should not return 500 errors. |
796 | 797 | request = self.client.get('/test_admin/admin/') |
… |
… |
class SecureViewTests(TestCase):
|
1350 | 1351 | self.assertContains(login, "Your e-mail address is not your username") |
1351 | 1352 | # only correct passwords get a username hint |
1352 | 1353 | login = self.client.post('/test_admin/admin/secure-view/', self.super_email_bad_login) |
1353 | | self.assertContains(login, "Please enter a correct username and password.") |
| 1354 | self.assertContains(login, ERROR_MESSAGE) |
1354 | 1355 | new_user = User(username='jondoe', password='secret', email='super@example.com') |
1355 | 1356 | new_user.save() |
1356 | 1357 | # check to ensure if there are multiple e-mail addresses a user doesn't get a 500 |
1357 | 1358 | login = self.client.post('/test_admin/admin/secure-view/', self.super_email_login) |
1358 | | self.assertContains(login, "Please enter a correct username and password.") |
| 1359 | self.assertContains(login, ERROR_MESSAGE) |
1359 | 1360 | |
1360 | 1361 | # Add User |
1361 | 1362 | request = self.client.get('/test_admin/admin/secure-view/') |
… |
… |
class SecureViewTests(TestCase):
|
1387 | 1388 | login = self.client.post('/test_admin/admin/secure-view/', self.joepublic_login) |
1388 | 1389 | self.assertEqual(login.status_code, 200) |
1389 | 1390 | # Login.context is a list of context dicts we just need to check the first one. |
1390 | | self.assertContains(login, "Please enter a correct username and password.") |
| 1391 | self.assertContains(login, ERROR_MESSAGE) |
1391 | 1392 | |
1392 | 1393 | # 8509 - if a normal user is already logged in, it is possible |
1393 | 1394 | # to change user into the superuser without error |