mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-09 08:00:52 +03:00
Merge pull request #4867 from micgeronimo/pagination-tests
Add test for pagination when limit not set
This commit is contained in:
commit
f9a0db3ee0
|
@ -370,6 +370,13 @@ class TestLimitOffset:
|
||||||
assert self.pagination.display_page_controls
|
assert self.pagination.display_page_controls
|
||||||
assert isinstance(self.pagination.to_html(), type(''))
|
assert isinstance(self.pagination.to_html(), type(''))
|
||||||
|
|
||||||
|
def test_pagination_not_applied_if_limit_or_default_limit_not_set(self):
|
||||||
|
class MockPagination(pagination.LimitOffsetPagination):
|
||||||
|
default_limit = None
|
||||||
|
request = Request(factory.get('/'))
|
||||||
|
queryset = MockPagination().paginate_queryset(self.queryset, request)
|
||||||
|
assert queryset is None
|
||||||
|
|
||||||
def test_single_offset(self):
|
def test_single_offset(self):
|
||||||
"""
|
"""
|
||||||
When the offset is not a multiple of the limit we get some edge cases:
|
When the offset is not a multiple of the limit we get some edge cases:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user