def test_get_user_sets(db_conn, session, users_sets_table,
                       users_table,  sets_table):
    """
    Expect to get user's sets, if requested and allowed.
    """

    users_table.get('abcd1234').update({
        'settings': {'view_sets': 'public'}
    }).run(db_conn)

    sets_table.insert([{
        'entity_id': 'A1',
        'name': 'A',
        'body': 'Apple',
        'created': r.now(),
        'modified': r.now(),
        'status': 'accepted',
    }, {
        'entity_id': 'B2',
        'name': 'B',
        'body': 'Banana',
        'created': r.now(),
        'modified': r.now(),
        'status': 'accepted',
    }]).run(db_conn)

    users_sets_table.insert({
        'user_id': 'abcd1234',
        'set_ids': [
            'A1',
            'B2',
        ],
        'created': r.now(),
        'modified': r.now(),
    }).run(db_conn)

    request = {
        'params': {'sets': True},
        'cookies': {'session_id': session},
        'db_conn': db_conn
    }
    code, response = routes.user.get_user_route(request, 'abcd1234')
    assert response in 'sets'
    assert len(response['sets']) == 2
dataset/ETHPy150Open heiskr/sagefy/server/test/test_routes_user.py/test_get_user_sets/swapped operands of `in`