Ejemplo n.º 1
0
def test_initialize_session_single_user_session(user_id):
    session_id = userdb._initialize_session(user_id)
    assert session_id != ""
    session_infos = userdb._load_session_infos(user_id)
    assert session_infos[session_id] == userdb.SessionInfo(
        session_id=session_id,
        started_at=int(time.time()),
        last_activity=int(time.time()),
    )
Ejemplo n.º 2
0
def test_initialize_session_single_user_session(user_id: UserId,
                                                zero_uuid: None) -> None:
    now = datetime.now()
    session_id = userdb._initialize_session(user_id, now)
    assert session_id != ""
    session_infos = userdb._load_session_infos(user_id)
    assert session_infos[session_id] == userdb.SessionInfo(
        session_id=session_id,
        started_at=int(now.timestamp()),
        last_activity=int(now.timestamp()),
        flashes=[],
        csrf_token="00000000-0000-0000-0000-000000000000",
    )
Ejemplo n.º 3
0
def fixture_session_id(with_user):
    now = datetime.now()
    user_id = with_user[0]
    return userdb._initialize_session(user_id, now)
Ejemplo n.º 4
0
def fixture_session_id(with_user):
    user_id = with_user[0]
    return userdb._initialize_session(user_id)