def test_score(db_conn, responses_table):

    response, errors = Response.insert(db_conn, {
        'user_id': 'A',
        'card_id': 'BC',
        'unit_id': 'RM',
        'response': 42,
        'learned': 0.9,
    })
    assert len(errors) == 1
    response['score'] = 1.1
    response, errors = response.save(db_conn)
    assert len(errors) == 1
    response['score'] = 0
    response, errors = response.save(db_conn)
    assert len(errors) == 0
    response['score'] = 1
    response, errors = response.save(db_conn)
    assert len(errors) == 0
Expect to have a score between 0 and 1 (including).
dataset/ETHPy150Open heiskr/sagefy/server/test/test_models_response.py/test_score