      def get_previous_link(self):
          if not self.has_previous:
              return None
  
          compare = self.previous_position
          offset = 0
          for item in self.page:
              position = self._get_position_from_instance(item, self.ordering)
              if position != compare:
                  # The item in this position and the item following it
 
</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             self.page = reversed(self.page)
 </s> add             self.page = list(reversed(self.page)) </s> remove             def filter(self, created__gt=None, created__lt=None):
                if created__gt is not None:
                    return MockQuerySet([
                        item for item in self.items
                        if item.created > int(created__gt)
                    ])
 </s> add     def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/') </s> remove     tokens = urlparse.parse_qs(b64decode(encoded), keep_blank_values=True)
 </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
      def get_previous_link(self):
          if not self.has_previous:
              return None
  
        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
          offset = 0
          for item in self.page:
              position = self._get_position_from_instance(item, self.ordering)
              if position != compare:
                  # The item in this position and the item following it
keep keep keep keep replace keep keep keep keep keep
 Tidy up cursor tests and make more comprehensive 
rest_framework/pagination.py