diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-10-11 21:39:22 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-10-23 09:10:45 -0400 |
| commit | 6ed347d8518e23d7e453bdb21f7fa59ce2c4a885 (patch) | |
| tree | e5816cf2283b6d956120a59a76b3baeb1f90c894 /tests/auth_tests | |
| parent | 7fb913c80555594a6dd756733fdb5869d5dba213 (diff) | |
Fixed #28706 -- Moved AuthenticationFormn invalid login ValidationError to a method for reuse.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_forms.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py index f15aef37e3..1832f81c1c 100644 --- a/tests/auth_tests/test_forms.py +++ b/tests/auth_tests/test_forms.py @@ -453,6 +453,17 @@ class AuthenticationFormTest(TestDataMixin, TestCase): self.assertEqual(form.errors, {}) self.assertEqual(form.user_cache, user) + def test_get_invalid_login_error(self): + error = AuthenticationForm().get_invalid_login_error() + self.assertIsInstance(error, forms.ValidationError) + self.assertEqual( + error.message, + 'Please enter a correct %(username)s and password. Note that both ' + 'fields may be case-sensitive.', + ) + self.assertEqual(error.code, 'invalid_login') + self.assertEqual(error.params, {'username': 'username'}) + class SetPasswordFormTest(TestDataMixin, TestCase): |
