Commit e3966c05 authored by Fabien Morin's avatar Fabien Morin

add a test to check that all sub-objects of the inheritance model dependencies...

add a test to check that all sub-objects of the inheritance model dependencies have been copied into the base model.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18322 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e96a8407
...@@ -980,6 +980,23 @@ class TestPayroll(TestPayrollMixin): ...@@ -980,6 +980,23 @@ class TestPayroll(TestPayrollMixin):
self.assertEqual(model_reference_dict[model_country.getRelativeUrl()], self.assertEqual(model_reference_dict[model_country.getRelativeUrl()],
['3','4', 'social_insurance']) ['3','4', 'social_insurance'])
# copy sub object from all inhéritance models into the base model
nb_subobject_before = len(model_employee.contentValues(\
portal_type=portal_type_list))
model_employee.copyInheritanceSubObjects(model_reference_dict)
nb_subobject_after = len(model_employee.contentValues(\
portal_type=portal_type_list))
# check there are all here:
nb_added_sub_objects = nb_subobject_after - nb_subobject_before
get_transaction().commit()
self.paysheet_model_module.reindexObject()
self.tic()
self.assertEqual(nb_added_sub_objects, 11)
import unittest import unittest
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment