Beispiel #1
0
 def test_field_source_override(self):
     """
     Test a Field with source overriden
     """
     field = Field(source='source')
     value = 'field_name'
     field.bind(self, 'field_name', {'source': value})
     self.assertEqual(value, field.serialize_value())
Beispiel #2
0
 def test_field_default(self):
     """
     Test a Field with default configuration
     """
     field = Field()
     value = 'field_name'
     field.bind(self, 'field_name', {'field_name': value})
     self.assertEqual(value, field.serialize_value())
     self.assertFalse(field.pk)
     self.assertIsNone(field.display_prompt)