def test(self): expected = 42 def default_callable(): return expected test_value = StringField(default=expected).bind(Json(), 'a') test_value.process(None) self.assertEqual(test_value.data, expected) test_callable = StringField(default=default_callable).bind(Json(), 'a') test_callable.process(None) self.assertEqual(test_callable.data, expected)
def test_no_filters(self): my_filter = lambda x: x self.assertRaises(TypeError, ListField, self.t, filters=[my_filter], _json=Json(), _name='foo')
def setUp(self): t = StringField(validators=[validators.DataRequired()]).bind( Json(), 'a') self.flags = t.flags