Roland Haroutiounian 9 years ago
parent
commit
b69b21b431
2 changed files with 3 additions and 8 deletions
  1. 1
    1
      EditorialModel/fields.py
  2. 2
    7
      EditorialModel/test/test_field.py

+ 1
- 1
EditorialModel/fields.py View File

51
             exists = EmField(name)
51
             exists = EmField(name)
52
         except EmComponentNotExistError:
52
         except EmComponentNotExistError:
53
             values = {
53
             values = {
54
-                'uid' : None,
54
+                #'uid' : None,
55
                 'name' : name,
55
                 'name' : name,
56
                 'fieldgroup_id' : em_fieldgroup.uid,
56
                 'fieldgroup_id' : em_fieldgroup.uid,
57
                 'fieldtype' : em_fieldtype.name,
57
                 'fieldtype' : em_fieldtype.name,

+ 2
- 7
EditorialModel/test/test_field.py View File

53
         self.testClass = EmClass.create("testclass1",EmClassType.entity)
53
         self.testClass = EmClass.create("testclass1",EmClassType.entity)
54
         self.testClassUid = self.testClass.uid
54
         self.testClassUid = self.testClass.uid
55
 
55
 
56
-        self.testType = EmType.create('testtype1',self.testClass)
57
-        self.testTypeUid = self.testType.uid
58
-
59
-        self.testFieldType = EmFieldType('testfieldtype1')
60
-        self.testFieldTypeUid = self.testFieldType.uid
56
+        self.testFieldType = EmField_integer()
61
 
57
 
62
         self.testFieldgroup = EmFieldGroup.create('fieldgrp1',self.testClass)
58
         self.testFieldgroup = EmFieldGroup.create('fieldgrp1',self.testClass)
63
-        self.testFieldgroupUid = self.testFieldgroup.uid
64
 
59
 
65
         pass
60
         pass
66
 
61
 
157
     # tests the creation process of a field
152
     # tests the creation process of a field
158
     def testCreate(self):
153
     def testCreate(self):
159
 
154
 
160
-        field = EmField.create('testfield1', self.testFieldgroup, self.testFieldtype)
155
+        field = EmField.create('testfield1', self.testFieldgroup, self.testFieldType)
161
         fieldUid = field.uid
156
         fieldUid = field.uid
162
         # We check that the field has been added in the em_field table
157
         # We check that the field has been added in the em_field table
163
         field_records = self.get_field_records(fieldUid)
158
         field_records = self.get_field_records(fieldUid)

Loading…
Cancel
Save