Updates to ComplexFields
Required now means they cannot be empty [#302]
This commit is contained in:
parent
17728d4e74
commit
6961a9494f
4 changed files with 22 additions and 5 deletions
|
|
@ -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."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue