          class MockQuerySet(object):
              def __init__(self, items):
                  self.items = items
  
              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)
                      ])
  
                  assert created__lt is not None
                  return MockQuerySet([
                      item for item in self.items
                      if item.created < int(created__lt)
 
</s> remove                 assert created__lt is not None
                return MockQuerySet([
                    item for item in self.items
                    if item.created < int(created__lt)
                ])
 </s> add         assert previous is None
        assert current == [1, 1, 1, 1, 1]
        assert next == [1, 2, 3, 4, 4] </s> remove         previous_url = self.pagination.get_previous_link()
        assert previous_url is None


class TestCrazyCursorPagination:
    """
    Unit tests for `pagination.CursorPagination`.
    """

    def setup(self):
        class MockObject(object):
            def __init__(self, idx):
                self.created = idx

        class MockQuerySet(object):
            def __init__(self, items):
                self.items = items
 </s> add     def test_invalid_cursor(self):
        request = Request(factory.get('/', {'cursor': '123'}))
        with pytest.raises(exceptions.NotFound):
            self.pagination.paginate_queryset(self.queryset, request) </s> remove             def order_by(self, ordering):
                if ordering.startswith('-'):
                    return MockQuerySet(reversed(self.items))
                return self
 </s> add         (previous, current, next, previous_url, next_url) = self.get_pages(next_url) </s> remove         previous_url = self.pagination.get_previous_link()
        assert previous_url
 </s> add         if previous_url is not None:
            request = Request(factory.get(previous_url))
            queryset = self.pagination.paginate_queryset(self.queryset, request)
            previous = [item.created for item in queryset]
        else:
            previous = None </s> remove         request = Request(factory.get(previous_url))
        queryset = self.paginate_queryset(request)
        assert [item.created for item in queryset] == [6, 7, 8, 9, 10]
 </s> add         if next_url is not None:
            request = Request(factory.get(next_url))
            queryset = self.pagination.paginate_queryset(self.queryset, request)
            next = [item.created for item in queryset]
        else:
            next = None
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
          class MockQuerySet(object):
              def __init__(self, items):
                  self.items = items
  
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
    def test_cursor_pagination(self):
        (previous, current, next, previous_url, next_url) = self.get_pages('/')
  
                  assert created__lt is not None
                  return MockQuerySet([
                      item for item in self.items
                      if item.created < int(created__lt)
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Tidy up cursor tests and make more comprehensive 
tests/test_pagination.py