def test_user_password(): user = User('This is me') assert user.check_password('badpassword') is False user.set_password('badpassword') assert '$rounds=' in user.password_hash assert user.check_password('badpassword') is True assert user.check_password('wrongpassword') is False