def test_get_latest(db_conn, responses_table):

    responses_table.insert([{
        'id': 'A',
        'user_id': 'abcd1234',
        'unit_id': 'apple',
        'created': r.now(),
        'modified': r.now(),
    }, {
        'id': 'B',
        'user_id': 'abcd1234',
        'unit_id': 'banana',
        'created': r.now(),
        'modified': r.now(),
    }]).run(db_conn)

    assert Response.get_latest(db_conn, 'abcd1234', 'apple')['id'] == 'A'
Expect to get the latest response by user and unit.
dataset/ETHPy150Open heiskr/sagefy/server/test/test_models_response.py/test_get_latest