diff options
| author | mimi89999 <michel@lebihan.pl> | 2025-02-09 17:14:08 +0100 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-02-18 08:58:49 +0100 |
| commit | 727731d76d9dfd5304d536478d862778f6dd6d9b (patch) | |
| tree | b0001cbe08132816d895dc8b8a7d704c4d866015 /tests/auth_tests | |
| parent | efb7f9ced2dcf71294353596a265e3fd67faffeb (diff) | |
Fixed #36179 -- Unhexed entries and removed duplicates in auth/common-passwords.txt.gz.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_validators.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auth_tests/test_validators.py b/tests/auth_tests/test_validators.py index d7e4968951..d6ee44511d 100644 --- a/tests/auth_tests/test_validators.py +++ b/tests/auth_tests/test_validators.py @@ -273,6 +273,15 @@ class CommonPasswordValidatorTest(SimpleTestCase): CommonPasswordValidator().validate("godzilla") self.assertEqual(cm.exception.messages, [expected_error]) + def test_common_hexed_codes(self): + expected_error = "This password is too common." + common_hexed_passwords = ["asdfjkl:", "ठ:"] + for password in common_hexed_passwords: + with self.subTest(password=password): + with self.assertRaises(ValidationError) as cm: + CommonPasswordValidator().validate(password) + self.assertEqual(cm.exception.messages, [expected_error]) + def test_validate_custom_list(self): path = os.path.join( os.path.dirname(os.path.realpath(__file__)), "common-passwords-custom.txt" |
