コード例 #1
0
async def test_add_new_attempt_of_login(tmpcwd, app):
    auth = NativeAuthenticator(db=app.db)

    assert not auth.login_attempts
    auth.add_login_attempt("username")
    assert auth.login_attempts["username"]["count"] == 1
    auth.add_login_attempt("username")
    assert auth.login_attempts["username"]["count"] == 2
コード例 #2
0
async def test_add_new_attempt_of_login(tmpcwd, app):
    auth = NativeAuthenticator(db=app.db)

    assert not auth.login_attempts
    auth.add_login_attempt('username')
    assert auth.login_attempts['username']['count'] == 1
    auth.add_login_attempt('username')
    assert auth.login_attempts['username']['count'] == 2