Exemplo n.º 1
0
 def test_field_source_override(self):
     """
     Test a StringField with source overriden
     """
     field = StringField(source='source')
     value = 'field_name'
     field.bind(self, 'field_name', {'source': value})
     self.assertIsInstance(field.serialize_value(), unicode)
     self.assertEqual(value, field.serialize_value())
Exemplo n.º 2
0
 def test_field_default(self):
     """
     Test a StringField with default configuration
     """
     field = StringField()
     value = 'field_name'
     field.bind(self, 'field_name', {'field_name': value})
     self.assertIsInstance(field.serialize_value(), unicode)
     self.assertEqual(value, field.serialize_value())
     self.assertFalse(field.pk)
     self.assertIsNone(field.display_prompt)