Example #1
0
 def test_field_schema_set_creation_with_basic_values(self):
     ds = DataSchema()
     ds.update(fieldschema_set=[{
         'field_key': 'email',
         'field_type': 'STRING'
     }])
     fs = ds.fieldschema_set.get()
     self.assertEquals(fs.field_key, 'email')
     self.assertEquals(fs.field_type, 'STRING')
Example #2
0
 def test_empty_field_schema_set(self):
     ds = DataSchema()
     ds.update(fieldschema_set=[])
     self.assertEquals(FieldSchema.objects.count(), 0)
Example #3
0
 def test_update_with_model_ctype_none(self):
     ds = DataSchema()
     ds.update(model_content_type=None)
     self.assertIsNone(ds.model_content_type)
Example #4
0
 def test_update_with_model_ctype_not_none(self):
     ds = DataSchema()
     ds.update(model_content_type=ContentType.objects.get_for_model(ds))
     self.assertEquals(ds.model_content_type, ContentType.objects.get_for_model(ds))
Example #5
0
 def test_update_no_values(self):
     ds = DataSchema()
     ds.update()
     self.assertIsNotNone(ds.id)