'Test repr behavior isnt destructive'

def test_repr(self):

    class Doc(Document, ):
        number = IntField()
        def __repr__(self):
            return ('<Doc:    %s>' % self.number)
    Doc.drop_collection()
    for i in range(1000):
        Doc(number=i).save()
    docs = Doc.objects.order_by('number')
    self.assertEqual(docs.count(), 1000)
    docs_string = ('%s' % docs)
    self.assertTrue(('Doc:    0' in docs_string))
    self.assertEqual(docs.count(), 1000)
    self.assertTrue(('(remaining    elements    truncated)' in ('%s' % docs)))
    docs = docs[1:4]
    self.assertEqual('[<Doc:    1>,    <Doc:    2>,    <Doc:    3>]', ('%s' % docs))
    self.assertEqual(docs.count(with_limit_and_skip=True), 3)
    for doc in docs:
        self.assertEqual('..    queryset    mid-iteration    ..', repr(docs))
