Browse Source

[Tests EmComponent] Added the support of MlString in check_equals

Roland Haroutiounian 9 years ago
parent
commit
1b3565d890
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      EditorialModel/test/test_component.py

+ 4
- 2
EditorialModel/test/test_component.py View File

@@ -159,7 +159,10 @@ class ComponentTestCase(TestCase):
159 159
         for vname in val:
160 160
             if vname in ['string', 'help']:  # Special test for mlstrings
161 161
                 # MlString comparison
162
-                vml = json.loads(val[vname])
162
+                if isinstance(val[vname], MlString):
163
+                    vml = val[vname].translations
164
+                else:
165
+                    vml = json.loads(val[vname])
163 166
                 for vn in vml:
164 167
                     self.assertEqual(vml[vn], getattr(test_comp, vname).get(vn), msg)
165 168
             elif vname in ['date_create', 'date_update']:
@@ -408,7 +411,6 @@ class TestCreate(ComponentTestCase):
408 411
         tc = EM_TEST_OBJECT.create_component(EmClass.__name__, vals)
409 412
         self.check_equals(EmClass, vals, tc, "The created EmTestComp hasn't the good property values")
410 413
 
411
-    pass
412 414
 '''
413 415
 #====================#
414 416
 # EmComponent.create #

Loading…
Cancel
Save