MCPcopy
hub / github.com/django/django / test_bad_algorithm

Method test_bad_algorithm

tests/auth_tests/test_hashers.py:261–269  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

259 self.assertFalse(check_password(None, make_password("lètmein")))
260
261 def test_bad_algorithm(self):
262 msg = (
263 "Unknown password hashing algorithm '%s'. Did you specify it in "
264 "the PASSWORD_HASHERS setting?"
265 )
266 with self.assertRaisesMessage(ValueError, msg % "lolcat"):
267 make_password("lètmein", hasher="lolcat")
268 with self.assertRaisesMessage(ValueError, msg % "lolcat"):
269 identify_hasher("lolcat$salt$hash")
270
271 def test_is_password_usable(self):
272 passwords = ("lètmein_badencoded", "", None)

Callers

nothing calls this directly

Calls 3

make_passwordFunction · 0.90
identify_hasherFunction · 0.90
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected