Accessing a missing field now returns None rather than raising an AttributeError

This commit is contained in:
Harry Marr
2009-12-24 17:10:36 +00:00
parent 3d70b65a45
commit f687bad202
5 changed files with 14 additions and 17 deletions

View File

@@ -228,7 +228,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(person_obj['_id'], person.id)
self.assertEqual(str(person_obj['_id']), person.id)
def test_delete(self):
"""Ensure that document may be deleted using the delete method.