diff options
| author | Alexander Gaevsky <sasha@sasha0.ru> | 2016-04-14 20:12:30 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-10 18:23:18 -0400 |
| commit | 536db42cf01ebe0dd633b131c3dbfc0bf743064f (patch) | |
| tree | b41566d66d755d438a87bd95be0d28887a04c919 /tests/auth_tests | |
| parent | 2d26b4637f0318736955b54b34f270fe9500f795 (diff) | |
Fixed #26097 -- Added password_validators_help_text_html to UserCreationForm.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_forms.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py index dde639dc01..28a40db852 100644 --- a/tests/auth_tests/test_forms.py +++ b/tests/auth_tests/test_forms.py @@ -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. |
