Exemple #1
0
 def testValidate(self):
     field = InterfaceField(title=u'Interface field',
                            description=u'',
                            readonly=False,
                            required=False)
     field.validate(DummyInterface)
     self.assertRaises(WrongType, field.validate, object())
Exemple #2
0
class IListTypeDefinition(Interface):
    """used for indicating the type of mailing list"""
    
    title = Attribute("displayable title of list type")
    description = Attribute("displayable description of list type")

    list_marker = InterfaceField(title=_(u'list marker'),
                                 description=_(u'marked interface used to indicate the list type'),
                                 constraint=IListType.providedBy)

    index = Int(title=_(u'sort index'))
 def testValidate(self):
     field = InterfaceField(title=u'Interface field', description=u'',
                  readonly=False, required=False)
     field.validate(DummyInterface)
     self.assertRaises(WrongType, field.validate, object())
Exemple #4
0
 def __init__(self, **kw):
     super(GlobalInterface, self).__init__(InterfaceField(), **kw)
Exemple #5
0
 def testValidateRequired(self):
     field = InterfaceField(title=u'Interface field',
                            description=u'',
                            readonly=False,
                            required=True)
     self.assertRaises(RequiredMissing, field.validate, None)