Skip to content

Instantly share code, notes, and snippets.

@ptone
Created December 15, 2012 23:35
Show Gist options
  • Save ptone/4300920 to your computer and use it in GitHub Desktop.
Save ptone/4300920 to your computer and use it in GitHub Desktop.
diff --git a/django/contrib/auth/tests/forms.py b/django/contrib/auth/tests/forms.py
index 2589068..bca79a4 100644
--- a/django/contrib/auth/tests/forms.py
+++ b/django/contrib/auth/tests/forms.py
@@ -100,7 +100,8 @@ 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': form.username_field.verbose_name})])
def test_inactive_user(self):
# The user is inactive.
diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py
index 0e83ca4..9b7e8cf 100644
--- a/django/contrib/auth/tests/views.py
+++ b/django/contrib/auth/tests/views.py
@@ -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': 'username'})
def logout(self):
response = self.client.get('/logout/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment