Browse Source

Add a test for EmField

Checking that internal='object' is reserved for common fields
Yann Weber 9 years ago
parent
commit
9df9095da3
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      EditorialModel/test/test_field.py

+ 5
- 0
EditorialModel/test/test_field.py View File

57
         field_components_records = EM_TEST_OBJECT.components(EmField)
57
         field_components_records = EM_TEST_OBJECT.components(EmField)
58
         self.assertIn(field, field_components_records)
58
         self.assertIn(field, field_components_records)
59
 
59
 
60
+    def test_invalid_internal(self):
61
+        """ Test that internal='object' is reserved for common_fields """
62
+        with self.assertRaises(ValueError, msg="Only common_fields should be internal='object'"):
63
+            field = EM_TEST_OBJECT.create_component(EmField.__name__, {'name': 'testbadinternal','internal': 'object', 'fieldgroup_id': self.test_fieldgroup.uid, 'fieldtype': self.test_fieldtype})
64
+
60
     ## Test_Deletion
65
     ## Test_Deletion
61
     #
66
     #
62
     # tests the deletion process of a field
67
     # tests the deletion process of a field

Loading…
Cancel
Save