def test_change_password(): """Ensure changing a user password works as expected.""" new_user = User("A_New_User", "lovesexsecretgod") new_user.change_password("lovesexsecretgod", "lovesexsecretgod1") # the old one shouldn't work assert not new_user.is_correct_password("lovesexsecretgod") # the new one should assert new_user.is_correct_password("lovesexsecretgod1")
def test_user_password_check(): """Ensure checking the password for a new user works correctly.""" new_user = User("myusername", "mypassword") assert new_user.is_correct_password("mypassword")