Ejemplo n.º 1
0
 def test_field_source_override(self):
     """
     Test a URIField with source overriden
     """
     field = URIField(source='source')
     value = 'field_name'
     field.bind(self, 'field_name', {'source': value})
     self.assertIsInstance(field.serialize_value(), unicode)
     self.assertEqual(value, field.serialize_value())
Ejemplo n.º 2
0
 def test_field_default(self):
     """
     Test a URIField with default configuration
     """
     field = URIField()
     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)
     self.assertIsNone(field.relation)