Added __len__ to QuerySet

This commit is contained in:
Harry Marr
2009-12-24 18:45:35 +00:00
parent 9bfe5c7a49
commit 17aef253cb
4 changed files with 17 additions and 13 deletions

View File

@@ -235,9 +235,9 @@ class DocumentTest(unittest.TestCase):
"""
person = self.Person(name="Test User", age=30)
person.save()
self.assertEqual(self.Person.objects.count(), 1)
self.assertEqual(len(self.Person.objects), 1)
person.delete()
self.assertEqual(self.Person.objects.count(), 0)
self.assertEqual(len(self.Person.objects), 0)
def test_save_custom_id(self):
"""Ensure that a document may be saved with a custom _id.