Example #1
0
def test_is_authenticated():
    user = User()
    assert not user.is_authenticated()

    user._session_token = 'invalid-session-token'
    assert not user.is_authenticated()

    user = User()
    user.set('username', 'user1_name')
    user.set('password', 'password')
    user.login()
    assert user.is_authenticated()
Example #2
0
def test_is_authenticated():
    user = User()
    assert not user.is_authenticated()

    user._session_token = 'invalid-session-token'
    assert not user.is_authenticated()

    user = User()
    user.set('username', 'user1_name')
    user.set('password', 'password')
    user.login()
    assert user.is_authenticated()
Example #3
0
def test_is_authenticated():
    user = User()
    assert not user.is_authenticated()

    user._session_token = "invalid-session-token"
    assert not user.is_authenticated()

    user = User()
    user.set("username", "user1_name")
    user.set("password", "password")
    user.login()
    assert user.is_authenticated()