Exemplo n.º 1
0
def test_token():
    base_test.reinit_table()
    email = "*****@*****.**"
    password = "******"
    user = logic_user.signup(email, password)
    assert user is not None
    login_result, login_user = logic_user.login(email, password)
    assert login_result
    assert login_user is not None
    auth_token = login_user["encrypted_token"]
    is_valid, user_id_from_token = logic_user.is_token_valid(auth_token)
    assert is_valid
    assert user_id_from_token == login_user["id"]
Exemplo n.º 2
0
def test_token():
    base_test.reinit_table()
    email = '*****@*****.**'
    password = '******'
    user = logic_user.signup(email, password)
    assert user is not None
    login_result, login_user = logic_user.login(email, password)
    assert login_result
    assert login_user is not None
    auth_token = login_user['encrypted_token']
    is_valid, user_id_from_token = logic_user.is_token_valid(auth_token)
    assert is_valid
    assert user_id_from_token == login_user['id']
Exemplo n.º 3
0
def test_signup_login():
    base_test.reinit_table()
    email = "*****@*****.**"
    password = "******"
    user = logic_user.signup(email, password)
    assert user is not None
    user_id = user["id"]
    user_from_db = logic_user.get_user_by_id(user_id)
    assert user_from_db is not None
    assert user_from_db["email"] == user["email"]
    login_result, login_user = logic_user.login(email, password)
    assert login_result
    assert login_user is not None
    assert login_user["email"] == user["email"]
Exemplo n.º 4
0
def test_signup_login():
    base_test.reinit_table()
    email = '*****@*****.**'
    password = '******'
    user = logic_user.signup(email, password)
    assert user is not None
    user_id = user['id']
    user_from_db = logic_user.get_user_by_id(user_id)
    assert user_from_db is not None
    assert user_from_db['email'] == user['email']
    login_result, login_user = logic_user.login(email, password)
    assert login_result
    assert login_user is not None
    assert login_user['email'] == user['email']
Exemplo n.º 5
0
def login(email, password, **kwargs):
    result, user = logic_user.login(email, password)
    if result:
        return user
    else:
        raise errors.UserLoginFailure()
Exemplo n.º 6
0
def login(**kwargs):
    result, user = logic_user.login(kwargs['name'], kwargs['password'])
    if result:
        return user
    else:
        raise errors.UserLoginFailure()
Exemplo n.º 7
0
def login(email, password, **kwargs):
    result, user = logic_user.login(email, password)
    if result:
        return user
    else:
        raise errors.UserLoginFailure()