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

Fixed #26097 -- Added password_validators_help_text_html to UserCreationForm.

This commit is contained in:
Alexander Gaevsky
2016-04-14 20:12:30 +03:00
committed by Tim Graham
parent 2d26b4637f
commit 536db42cf0
4 changed files with 19 additions and 1 deletions

View File

@@ -236,6 +236,16 @@ class UserCreationFormTest(TestDataMixin, TestCase):
self.assertEqual(form.cleaned_data['password1'], data['password1'])
self.assertEqual(form.cleaned_data['password2'], data['password2'])
@override_settings(AUTH_PASSWORD_VALIDATORS=[
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
])
def test_password_help_text(self):
form = UserCreationForm()
self.assertEqual(
form.fields['password1'].help_text,
'<ul><li>Your password can&#39;t be too similar to your other personal information.</li></ul>'
)
# To verify that the login form rejects inactive users, use an authentication
# backend that allows them.