def test_query_term_user(self, db_request):
    user0 = UserFactory.create()
    user1 = UserFactory.create()
    journals0 = sorted([JournalEntryFactory.create(submitted_by=user0) for _ in range(30)], key=(lambda j: (j.submitted_date, j.id)), reverse=True)
    [JournalEntryFactory.create(submitted_by=user1) for _ in range(30)]
    db_request.GET['q'] = 'user:{}'.format(user0.username)
    result = views.journals_list(db_request)
    assert (result == {'journals': journals0[:25], 'query': 'user:{}'.format(user0.username)})
def test_query_term_user(self, db_request):
    user0 = UserFactory.create()
    user1 = UserFactory.create()
    journals0 = sorted([JournalEntryFactory.create(submitted_by=user0) for _ in range(30)], key=(lambda j: (j.submitted_date, j.id)), reverse=True)
    [JournalEntryFactory.create(submitted_by=user1) for _ in range(30)]
    db_request.GET['q'] = 'user:{}'.format(user0.username)
    result = views.journals_list(db_request)
    assert (result == {'journals': journals0[:25], 'query': 'user:{}'.format(user0.username)})