              'count': 50
          }
  
      def test_404_not_found_for_invalid_page(self):
          request = factory.get('/', {'page': 'invalid'})
          response = self.view(request)
          assert response.status_code == status.HTTP_404_NOT_FOUND
          assert response.data == {
 
</s> remove         self.ordering = self.get_ordering(view)
 </s> add         self.ordering = self.get_ordering(request, queryset, view) </s> remove     def remove_invalid_fields(self, queryset, ordering, view):
 </s> add     def remove_invalid_fields(self, queryset, fields, view): </s> remove         ordering = self.get_ordering(request)

        if ordering:
            # Skip any incorrect parameters
            ordering = self.remove_invalid_fields(queryset, ordering, view)

        if not ordering:
            # Use 'ordering' attribute by default
            ordering = self.get_default_ordering(view)
 </s> add         ordering = self.get_ordering(request, queryset, view) </s> remove             return [param.strip() for param in params.split(',')]
 </s> add             fields = [param.strip() for param in params.split(',')]
            ordering = self.remove_invalid_fields(queryset, fields, view)
            if ordering:
                return ordering

        # No ordering was included, or all the ordering fields were invalid
        return self.get_default_ordering(view) </s> remove     def get_ordering(self, request):
 </s> add     def get_ordering(self, request, queryset, view):
    def test_404_not_found_for_zero_page(self):
        request = factory.get('/', {'page': '0'})
        response = self.view(request)
        assert response.status_code == status.HTTP_404_NOT_FOUND
        assert response.data == {
            'detail': 'Invalid page "0": That page number is less than 1.'
        }

              'count': 50
          }
  
    def test_404_not_found_for_zero_page(self):
        request = factory.get('/', {'page': '0'})
        response = self.view(request)
        assert response.status_code == status.HTTP_404_NOT_FOUND
        assert response.data == {
            'detail': 'Invalid page "0": That page number is less than 1.'
        }

      def test_404_not_found_for_invalid_page(self):
          request = factory.get('/', {'page': 'invalid'})
          response = self.view(request)
          assert response.status_code == status.HTTP_404_NOT_FOUND
          assert response.data == {
keep keep add keep keep keep keep keep
 Cursor pagination now works with OrderingFilter 
tests/test_pagination.py