def test_verify_password_is_true_for_empty_pw_with_insecure_mode(): login = Login(username='******', password='') login.user = Munch(password='******') assert login.verify_password(True) is True
def test_verify_password_is_false_when_user_pw_is_none(): login = Login() login.user = Munch(password=None) assert login.verify_password(False) is False
def test_find_user_with_wrong_username(req): login = Login(request=req, username='******', password='') assert not login.find_user()
def test_verify_password_without_user_raises_value_error(): login = Login() with raises(ValueError): login.verify_password(False)
def test_find_user_with_wrong_username_raises_user_not_found(req): login = Login(request=req, username='******', password='') with raises(UserNotFound): login.find_user()