diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/auth_tests/test_forms.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py index ac23c2e96a..d77c9a976b 100644 --- a/tests/auth_tests/test_forms.py +++ b/tests/auth_tests/test_forms.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime @@ -350,6 +351,23 @@ class SetPasswordFormTest(TestDataMixin, TestCase): self.assertEqual(form.cleaned_data['new_password1'], data['new_password1']) self.assertEqual(form.cleaned_data['new_password2'], data['new_password2']) + @override_settings(AUTH_PASSWORD_VALIDATORS=[ + {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'}, + {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 'OPTIONS': { + 'min_length': 12, + }}, + ]) + def test_help_text_translation(self): + french_help_texts = [ + 'Votre mot de passe ne peut pas trop ressembler à vos autres informations personnelles.', + 'Votre mot de passe doit contenir au minimum 12 caractères.', + ] + form = SetPasswordForm(self.u1) + with translation.override('fr'): + html = form.as_p() + for french_text in french_help_texts: + self.assertIn(french_text, html) + class PasswordChangeFormTest(TestDataMixin, TestCase): |
