diff --git a/tests/auth_tests/test_validators.py b/tests/auth_tests/test_validators.py index d43efc6a3c..e50da39663 100644 --- a/tests/auth_tests/test_validators.py +++ b/tests/auth_tests/test_validators.py @@ -57,6 +57,18 @@ class PasswordValidationTest(TestCase): def test_password_changed(self): self.assertIsNone(password_changed('password')) + def test_password_changed_with_custom_validator(self): + class Validator: + def password_changed(self, password, user): + self.password = password + self.user = user + + user = object() + validator = Validator() + password_changed('password', user=user, password_validators=(validator,)) + self.assertIs(validator.user, user) + self.assertEqual(validator.password, 'password') + def test_password_validators_help_texts(self): help_texts = password_validators_help_texts() self.assertEqual(len(help_texts), 2)