def test_query_basic(self, db_request):
    project0 = ProjectFactory.create()
    project1 = ProjectFactory.create()
    journals0 = sorted([JournalEntryFactory.create(name=project0.normalized_name) for _ in range(30)], key=(lambda j: (j.submitted_date, j.id)), reverse=True)
    [JournalEntryFactory.create(name=project1.normalized_name) for _ in range(30)]
    db_request.GET['q'] = '{}'.format(project0.name)
    result = views.journals_list(db_request)
    assert (result == {'journals': journals0[:25], 'query': '{}'.format(project0.name)})
def test_query_basic(self, db_request):
    project0 = ProjectFactory.create()
    project1 = ProjectFactory.create()
    journals0 = sorted([JournalEntryFactory.create(name=project0.normalized_name) for _ in range(30)], key=(lambda j: (j.submitted_date, j.id)), reverse=True)
    [JournalEntryFactory.create(name=project1.normalized_name) for _ in range(30)]
    db_request.GET['q'] = '{}'.format(project0.name)
    result = views.journals_list(db_request)
    assert (result == {'journals': journals0[:25], 'query': '{}'.format(project0.name)})