mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +03:00
Test pass
This commit is contained in:
parent
b089edcd06
commit
0dd0873b41
|
@ -632,9 +632,9 @@ class CursorPagination(BasePagination):
|
|||
else:
|
||||
kwargs = {order_attr + '__gt': current_position}
|
||||
|
||||
# If some records contain a null for the ordering field, don't lose them.
|
||||
filter_query = Q(**kwargs)
|
||||
if reverse:
|
||||
# If some records contain a null for the ordering field, don't lose them.
|
||||
if (reverse and not is_reversed) or is_reversed:
|
||||
filter_query |= Q(**{order_attr + '__isnull': True})
|
||||
queryset = queryset.filter(filter_query)
|
||||
|
||||
|
|
|
@ -1154,7 +1154,7 @@ class TestCursorPaginationWithNulls(TestCase):
|
|||
assert current == [None]
|
||||
assert next == [None]
|
||||
|
||||
def test_decending(self):
|
||||
def test_descending(self):
|
||||
"""Test paginating one row at a time, current should go 4, 3, 2, 1, 2, 3, 4."""
|
||||
self.pagination.ordering = ('-created',)
|
||||
(previous, current, next, previous_url, next_url) = self.get_pages('/')
|
||||
|
|
Loading…
Reference in New Issue
Block a user