find_one now supports using just an object id

This commit is contained in:
Harry Marr
2009-11-19 20:28:43 +00:00
parent 744077b150
commit 90e27cc87d
2 changed files with 22 additions and 5 deletions

View File

@@ -96,6 +96,10 @@ class CollectionManagerTest(unittest.TestCase):
person = self.Person.objects.find_one(age__lt=30)
self.assertEqual(person.name, "User A")
# Find a document using just the object id
person = self.Person.objects.find_one(person1._id)
self.assertEqual(person.name, "User A")
def test_find_embedded(self):
"""Ensure that an embedded document is properly returned from a query.