Ticket #30776: tests-30776.diff

File tests-30776.diff, 1.0 KB (added by Mariusz Felisiak, 5 years ago)

Regression test.

  • tests/auth_tests/test_forms.py

    diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py
    index 7085dcfa11..40e3050144 100644
    a b class AuthenticationFormTest(TestDataMixin, TestCase):  
    423423        CustomEmailField.objects.create_user(**data)
    424424        form = AuthenticationForm(None, data)
    425425        self.assertEqual(form.fields['username'].max_length, 255)
     426        self.assertEqual(form.fields['username'].widget.attrs.get('maxlength'), 255)
    426427        self.assertEqual(form.errors, {})
    427428
    428429    @override_settings(AUTH_USER_MODEL='auth_tests.IntegerUsernameUser')
    class AuthenticationFormTest(TestDataMixin, TestCase):  
    435436        IntegerUsernameUser.objects.create_user(**data)
    436437        form = AuthenticationForm(None, data)
    437438        self.assertEqual(form.fields['username'].max_length, 254)
     439        self.assertEqual(form.fields['username'].widget.attrs.get('maxlength'), 254)
    438440        self.assertEqual(form.errors, {})
    439441
    440442    def test_username_field_label(self):
Back to Top