You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Still regressions on the Bool default thing....
since
I'd expect that
IBool['default'] == Bool().default
andIBool['required'] == Bool().required
otherwiseBool
violates it's interface contract.The text was updated successfully, but these errors were encountered: