Exemplo n.º 1
0
 def test_string_field_dumps_enforce_type(self):
     field = StringField(enforce_type=True)
     for value in [1, 1.2, True, object(), {}, []]:
         with self.assertRaises(ValueError):
             field.dumps(value)
     self.assertEqual("foo", field.dumps("foo"))
Exemplo n.º 2
0
 def test_string_field_dumps_no_enforce_type(self):
     field = StringField()
     for value in [1, 1.2, True, "foo", object(), {}, []]:
         self.assertEqual(value, field.dumps(value))