-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Still regressions on the Bool default thing....
def test_field_Bool_is_required(self):
# the Bool field is required by default
from zope.schema import Bool
field = Bool(__name__='testing')
self.assertTrue(field.required)
def test_field_Bool_default_is_None(self):
# the Bool field has no default set (None)
from zope.schema import Bool
field = Bool(__name__='testing')
self.assertIsNone(field.default)
def test_bool_not_required(self):
"""If class Bool is used as a schema itself, it must not be required.
"""
from zope.schema.interfaces import IBool
# treat IBool as schema with fields
field = IBool.get("required")
self.assertFalse(field.required)
def test_bool_defaults_to_false(self):
"""If class Bool is used as a schema itself, it must default to False
"""
from zope.schema.interfaces import IBool
# treat IBool as schema with fields
field = IBool.get("default")
self.assertFalse(field.default)
since
classImplementsFirst(Bool, IBool)
I'd expect that IBool['default'] == Bool().default and IBool['required'] == Bool().required otherwise Bool violates it's interface contract.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels