      # TODO: handle queries with '' as a legitimate position
      # Support case where ordering is already negative
      # Support tuple orderings
      cursor_query_param = 'cursor'
      page_size = 5
  
      def paginate_queryset(self, queryset, request, view=None):
          self.base_url = request.build_absolute_uri()
          self.ordering = self.get_ordering()
  
 
</s> remove             self.page = reversed(self.page)
 </s> add             self.page = list(reversed(self.page)) </s> remove         self.pagination = pagination.CursorPagination()
        self.queryset = MockQuerySet(
            [MockObject(idx) for idx in range(1, 16)]
        )

    def paginate_queryset(self, request):
        return list(self.pagination.paginate_queryset(self.queryset, request))

    # def get_paginated_content(self, queryset):
    #     response = self.pagination.get_paginated_response(queryset)
    #     return response.data

    # def get_html_context(self):
    #     return self.pagination.get_html_context()

    def test_following_cursor(self):
        request = Request(factory.get('/'))
        queryset = self.paginate_queryset(request)
        assert [item.created for item in queryset] == [1, 2, 3, 4, 5]

        next_url = self.pagination.get_next_link()
        assert next_url
 </s> add         class ExamplePagination(pagination.CursorPagination):
            page_size = 5 </s> remove         compare = self.next_position
 </s> add         if self.cursor and self.cursor.reverse and self.cursor.offset != 0:
            # If we're reversing direction and we have an offset cursor
            # then we cannot use the first position we find as a marker.
            compare = self._get_position_from_instance(self.page[-1], self.ordering)
        else:
            compare = self.next_position </s> remove         compare = self.previous_position
 </s> add         if self.cursor and not self.cursor.reverse and self.cursor.offset != 0:
            # If we're reversing direction and we have an offset cursor
            # then we cannot use the first position we find as a marker.
            compare = self._get_position_from_instance(self.page[0], self.ordering)
        else:
            compare = self.previous_position </s> remove             # TODO: Invalid cursors should 404
 </s> add 
    page_size = api_settings.PAGINATE_BY
    invalid_cursor_message = _('Invalid cursor')
      # TODO: handle queries with '' as a legitimate position
      # Support case where ordering is already negative
      # Support tuple orderings
      cursor_query_param = 'cursor'
    page_size = api_settings.PAGINATE_BY
    invalid_cursor_message = _('Invalid cursor')
  
      def paginate_queryset(self, queryset, request, view=None):
          self.base_url = request.build_absolute_uri()
          self.ordering = self.get_ordering()
  
keep keep keep keep replace keep keep keep keep keep
 Tidy up cursor tests and make more comprehensive 
rest_framework/pagination.py