              if position != compare:
                  # The item in this position and the item following it
                  # have different positions. We can use this position as
                  # our marker.
                  has_item_with_unique_position = True
                  break
  
              # The item in this position has the same position as the item
              # following it, we can't use it as a marker position, so increment
              # the offset and keep seeking to the previous item.
 
</s>
                has_item_with_unique_position = position is not None
              if position != compare:
                  # The item in this position and the item following it
                  # have different positions. We can use this position as
                  # our marker.
                has_item_with_unique_position = position is not None
                  break
  
              # The item in this position has the same position as the item
              # following it, we can't use it as a marker position, so increment
              # the offset and keep seeking to the previous item.
keep keep keep keep replace keep keep keep keep keep
 Ensure CursorPagination respects nulls in the ordering field (#8912)

* Ensure CursorPagination respects nulls in the ordering field

* Lint

* Fix pagination tests

* Add test_ascending with nulls

* Push tests for nulls

* Test pass

* Add comment

* Fix test for django30
rest_framework/pagination.py