1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #16860 -- Minor edits and fixes to password validation.

This commit is contained in:
Tim Graham
2015-06-08 13:27:47 -04:00
parent a0047c6242
commit 55b3bd8468
6 changed files with 68 additions and 31 deletions

View File

@@ -278,8 +278,11 @@ class SetPasswordFormTest(TestDataMixin, TestCase):
form = SetPasswordForm(user, data)
self.assertFalse(form.is_valid())
self.assertEqual(len(form["new_password2"].errors), 2)
self.assertTrue('The password is too similar to the username.' in form["new_password2"].errors)
self.assertTrue('This password is too short. It must contain at least 12 characters.' in form["new_password2"].errors)
self.assertIn('The password is too similar to the username.', form["new_password2"].errors)
self.assertIn(
'This password is too short. It must contain at least 12 characters.',
form["new_password2"].errors
)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'])