"""Password hashing tests.""" from models import hash_password, verify_password def test_hash_and_verify(): h = hash_password("s3cure-Passw0rd!") assert verify_password("s3cure-Passw0rd!", h) def test_wrong_password_rejected(): h = hash_password("s3cure-Passw0rd!") assert not verify_password("wrong-password", h) def test_hashes_are_unique(): assert hash_password("same-pass") != hash_password("same-pass") def test_accepts_bytes_hash(): h = hash_password("s3cure-Passw0rd!") assert verify_password("s3cure-Passw0rd!", h.encode())