diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py index 754149dcea..7435569a7c 100644 --- a/tests/auth_tests/test_hashers.py +++ b/tests/auth_tests/test_hashers.py @@ -50,6 +50,12 @@ class TestUtilsHashPass(SimpleTestCase): self.assertTrue(check_password('', blank_encoded)) self.assertFalse(check_password(' ', blank_encoded)) + def test_bytes(self): + encoded = make_password(b'bytes_password') + self.assertTrue(encoded.startswith('pbkdf2_sha256$')) + self.assertIs(is_password_usable(encoded), True) + self.assertIs(check_password(b'bytes_password', encoded), True) + def test_pbkdf2(self): encoded = make_password('lètmein', 'seasalt', 'pbkdf2_sha256') self.assertEqual(encoded, 'pbkdf2_sha256$216000$seasalt$youGZxOw6ZOcfrXv2i8/AhrnpZflJJ9EshS9XmUJTUg=')