1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Corrected tests depending on the error message on the AuthenticationForm.

Refs #19368, and the fix introduced in 27f8129d64.
This commit is contained in:
Russell Keith-Magee
2012-12-16 07:18:45 +08:00
parent 27f8129d64
commit 9facca28b6
3 changed files with 7 additions and 3 deletions

View File

@@ -100,7 +100,9 @@ class AuthenticationFormTest(TestCase):
form = AuthenticationForm(None, data)
self.assertFalse(form.is_valid())
self.assertEqual(form.non_field_errors(),
[force_text(form.error_messages['invalid_login'])])
[force_text(form.error_messages['invalid_login'] % {
'username': User._meta.get_field('username').verbose_name
})])
def test_inactive_user(self):
# The user is inactive.

View File

@@ -248,7 +248,9 @@ class ChangePasswordTest(AuthViewsTestCase):
'username': 'testclient',
'password': password,
})
self.assertContainsEscaped(response, AuthenticationForm.error_messages['invalid_login'])
self.assertContainsEscaped(response, AuthenticationForm.error_messages['invalid_login'] % {
'username': User._meta.get_field('username').verbose_name
})
def logout(self):
response = self.client.get('/logout/')