def testValidateRequired(self):
        field = Bool(title=u'Bool field', description=u'',
                     readonly=False, required=True)
        field.validate(True)
        field.validate(False)

        self.assertRaises(RequiredMissing, field.validate, None)
示例#2
0
 def testValidate(self):
     field = Bool(title=u('Bool field'),
                  description=u(''),
                  readonly=False,
                  required=False)
     field.validate(None)
     field.validate(True)
     field.validate(False)
示例#3
0
    def testValidateRequired(self):
        field = Bool(title=u('Bool field'),
                     description=u(''),
                     readonly=False,
                     required=True)
        field.validate(True)
        field.validate(False)

        self.assertRaises(RequiredMissing, field.validate, None)
 def testValidate(self):
     field = Bool(title=u'Bool field', description=u'',
                  readonly=False, required=False)
     field.validate(None)
     field.validate(True)
     field.validate(False)