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:
committed by
Tim Graham
parent
2d26b4637f
commit
536db42cf0
@@ -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'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.
|
||||
|
||||
Reference in New Issue
Block a user