Updates to ComplexFields
Required now means they cannot be empty [#302]
This commit is contained in:
@@ -526,7 +526,7 @@ class FieldTest(unittest.TestCase):
|
||||
|
||||
self.assertRaises(ValidationError, e.save)
|
||||
|
||||
def test_list_field_required(self):
|
||||
def test_complex_field_required(self):
|
||||
"""Ensure required cant be None / Empty"""
|
||||
|
||||
class Simple(Document):
|
||||
@@ -538,6 +538,15 @@ class FieldTest(unittest.TestCase):
|
||||
|
||||
self.assertRaises(ValidationError, e.save)
|
||||
|
||||
class Simple(Document):
|
||||
mapping = DictField(required=True)
|
||||
|
||||
Simple.drop_collection()
|
||||
e = Simple()
|
||||
e.mapping = {}
|
||||
|
||||
self.assertRaises(ValidationError, e.save)
|
||||
|
||||
def test_list_field_complex(self):
|
||||
"""Ensure that the list fields can handle the complex types."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user