Fix querying an embedded document field by an invalid value (#1440)

This commit is contained in:
Manuel Jeckelmann
2016-12-22 19:19:18 +01:00
committed by Stefan Wójcik
parent 96d20756ca
commit 9f4b04ea0f
4 changed files with 30 additions and 6 deletions

View File

@@ -1860,6 +1860,10 @@ class InstanceTest(unittest.TestCase):
'occurs': {"hello": None}
})
# Tests for issue #1438: https://github.com/MongoEngine/mongoengine/issues/1438
with self.assertRaises(ValueError):
Word._from_son('this is not a valid SON dict')
def test_reverse_delete_rule_cascade_and_nullify(self):
"""Ensure that a referenced document is also deleted upon deletion.
"""