@pytest.mark.django_db
def test_get_units_ordered(rf, default, admin, numbered_po):
 view = get_units
 tp = numbered_po.translation_project
 url = ('/?path=/%s/%s/&filter=incomplete&sort=newest&initial=true' % (tp.language.code, tp.project.code))
 request = create_api_request(rf, url=url, user=default)
 response = view(request)
 assert (response.status_code == 200)
 request = create_api_request(rf, url=url, user=admin)
 response = view(request)
 assert (response.status_code == 200)

@ pytest . mark . django_db def test_get_units_ordered ( rf , default , admin , numbered_po ) : view = get_units tp = numbered_po . translation_project url = ( '/?path=/%s/%s/&filter=incomplete&sort=newest&initial=true' % ( tp . language . code , tp . project . code ) ) request = create_api_request ( rf , url = url , user = default ) response = view ( request ) assert ( response . status_code == 200 ) request = create_api_request ( rf , url = url , user = admin ) response = view ( request ) assert ( response . status_code == 200 )
tests units can be retrieved while applying order filters .