def test_user_log_out(db_conn, users_table):
    """
    Ensure a user can log out.
    """

    create_user_in_db(users_table, db_conn)
    request = {
        'params': {'name': 'test', 'password': 'abcd1234'},
        'db_conn': db_conn
    }
    code, response = routes.user.log_in_route(request)
    assert code == 200
    session_id = response['cookies']['session_id']
    request = {'cookies': {'session_id': session_id}}
    code, response = routes.user.log_out_route(request)
    assert code == 200
    assert 'cookies' in response
dataset/ETHPy150Open heiskr/sagefy/server/test/test_routes_user.py/test_user_log_out/original