def test_get_user_posts(db_conn, session, posts_table):
    """
    Expect to get user's 10 latest posts when requested in addition.
    """

    posts_table.insert([{
        'created': r.now(),
        'modified': r.now(),
        'user_id': 'abcd1234',
        'topic_id': 'fj2Ojfdskl2',
        'body': '''A Modest Proposal for Preventing the Children of Poor
            People From Being a Burthen to Their Parents or Country, and
            for Making Them Beneficial to the Publick.''',
        'kind': 'post',
    }, {
        'created': r.now(),
        'modified': r.now(),
        'user_id': 'gjrklj15431',
        'topic_id': 'fj2Ojfdskl2',
        'body': '''A Modest Proposal for Preventing the Children of Poor
            People From Being a Burthen to Their Parents or Country, and
            for Making Them Beneficial to the Publick.''',
        'kind': 'post',
    }, {
        'created': r.now(),
        'modified': r.now(),
        'user_id': 'abcd1234',
        'topic_id': 'fj2Ojfdskl2',
        'body': '''A Modest Proposal for Preventing the Children of Poor
            People From Being a Burthen to Their Parents or Country, and
            for Making Them Beneficial to the Publick.''',
        'kind': 'post',
    }]).run(db_conn)

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