Added basic querying - find and find_one

This commit is contained in:
Harry Marr
2009-11-19 01:09:58 +00:00
parent 94be32b387
commit 8ec6fecd23
7 changed files with 141 additions and 12 deletions

View File

@@ -97,6 +97,7 @@ class DocumentTest(unittest.TestCase):
person_obj = collection.find_one({'name': 'Test User'})
self.assertEqual(person_obj['name'], 'Test User')
self.assertEqual(person_obj['age'], 30)
self.assertEqual(str(person_obj['_id']), person._id)
def test_save_custom_id(self):
"""Ensure that a document may be saved with a custom _id.