summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_forms.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-06-08 13:27:47 -0400
committerTim Graham <timograham@gmail.com>2015-06-10 07:41:01 -0400
commit55b3bd84681a87266f6bef72480aaef48a7c295f (patch)
tree4413b39f348f0a0d017db07c182ec4e0af8e6f24 /tests/auth_tests/test_forms.py
parenta0047c6242fd48068eb444e0a58f7a5d2bc1bcd3 (diff)
Refs #16860 -- Minor edits and fixes to password validation.
Diffstat (limited to 'tests/auth_tests/test_forms.py')
-rw-r--r--tests/auth_tests/test_forms.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py
index c469201408..2771c09111 100644
--- a/tests/auth_tests/test_forms.py
+++ b/tests/auth_tests/test_forms.py
@@ -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'])