more test cov

This commit is contained in:
Bastien Gérard
2019-05-12 22:58:17 +02:00
parent f28e1b8c90
commit 00d2fd685a
9 changed files with 42 additions and 33 deletions

View File

@@ -420,6 +420,12 @@ class InstanceTest(MongoDBTestCase):
person.save()
person.to_dbref()
def test_key_like_attribute_access(self):
person = self.Person(age=30)
self.assertEqual(person['age'], 30)
with self.assertRaises(KeyError):
person['unknown_attr']
def test_save_abstract_document(self):
"""Saving an abstract document should fail."""
class Doc(Document):