<s> from django . core . urlresolvers import reverse <EOL> from django . conf import settings <EOL> import pytest <EOL> from example . views import EntryViewSet <EOL> from rest_framework_json_api . pagination import PageNumberPagination <EOL> from example . tests . utils import dump_json , redump_json <EOL> pytestmark = pytest . mark . django_db <EOL> def test_multiple_entries_no_pagination ( multiple_entries , rf ) : <EOL> expected = { <EOL> "<STR_LIT:data>" : [ <EOL> { <EOL> "<STR_LIT:type>" : "<STR_LIT>" , <EOL> "<STR_LIT:id>" : "<STR_LIT:1>" , <EOL> "<STR_LIT>" : <EOL> { <EOL> "<STR_LIT>" : multiple_entries [ <NUM_LIT:0> ] . headline , <EOL> "<STR_LIT>" : multiple_entries [ <NUM_LIT:0> ] . body_text , <EOL> "<STR_LIT>" : None , <EOL> "<STR_LIT>" : None <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT:text>" <EOL> } , <EOL> "<STR_LIT>" : <EOL> { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:data>" : { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:1>" } <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT:1> } , <EOL> "<STR_LIT:data>" : [ { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:1>" } ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT:1> } , <EOL> "<STR_LIT:data>" : [ { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:1>" } ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:data>" : [ { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:2>" } ] <EOL> } <EOL> } <EOL> } , <EOL> { <EOL> "<STR_LIT:type>" : "<STR_LIT>" , <EOL> "<STR_LIT:id>" : "<STR_LIT:2>" , <EOL> "<STR_LIT>" : <EOL> { <EOL> "<STR_LIT>" : multiple_entries [ <NUM_LIT:1> ] . headline , <EOL> "<STR_LIT>" : multiple_entries [ <NUM_LIT:1> ] . body_text , <EOL> "<STR_LIT>" : None , <EOL> "<STR_LIT>" : None <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT:text>" <EOL> } , <EOL> "<STR_LIT>" : <EOL> { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:data>" : { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:2>" } <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT:1> } , <EOL> "<STR_LIT:data>" : [ { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:2>" } ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT:1> } , <EOL> "<STR_LIT:data>" : [ { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:2>" } ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT:data>" : [ { "<STR_LIT:type>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT:1>" } ] <EOL> } <EOL> } <EOL> } , <EOL> ] <EOL> } <EOL> class NoPagination ( PageNumberPagination ) : <EOL> page_size = None <EOL> class NonPaginatedEntryViewSet ( EntryViewSet ) : <EOL> pagination_class = NoPagination <EOL> request = rf . get ( <EOL> reverse ( "<STR_LIT>" ) ) <EOL> view = NonPaginatedEntryViewSet . as_view ( { '<STR_LIT>' : '<STR_LIT:list>' } ) <EOL> response = view ( request ) <EOL> response . render ( ) <EOL> content_dump = redump_json ( response . content ) <EOL> expected_dump = dump_json ( expected ) <EOL> assert content_dump == expected_dump </s>
