예제 #1
0
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
예제 #2
0
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
예제 #3
0
def test_find_user_with_wrong_username(req):
    login = Login(request=req, username='******', password='')
    assert not login.find_user()
예제 #4
0
def test_verify_password_without_user_raises_value_error():
    login = Login()
    with raises(ValueError):
        login.verify_password(False)
예제 #5
0
def test_find_user_with_wrong_username_raises_user_not_found(req):
    login = Login(request=req, username='******', password='')
    with raises(UserNotFound):
        login.find_user()