def test_get_user_follows(db_conn, session, users_table, follows_table):
    """
    Expect to get user's follows, if requested and allowed.
    """

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

    follows_table.insert([{
        'id': 'JIkfo034n',
        'user_id': 'abcd1234',
        'entity': {
            'kind': 'card',
            'id': 'JFlsjFm',
        },
        'created': r.now(),
        'modified': r.now(),
    }]).run(db_conn)

    request = {
        'params': {'follows': True},
        'cookies': {'session_id': session},
        'db_conn': db_conn
    }
    code, response = routes.user.get_user_route(request, 'abcd1234')
    assert 'follows' in response
    assert len(response['follows']) == 1
dataset/ETHPy150Open heiskr/sagefy/server/test/test_routes_user.py/test_get_user_follows/original