mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Fixed #28706 -- Moved AuthenticationFormn invalid login ValidationError to a method for reuse.
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user