Commit a16bffe5 authored by Vincent Pelletier's avatar Vincent Pelletier

Add a test for setId on a module containing an object to which another object is related.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4891 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b7efbce
...@@ -100,6 +100,7 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -100,6 +100,7 @@ class TestERP5Category(ERP5TypeTestCase):
self.login() self.login()
# This add the base category size # This add the base category size
portal_categories = self.getCategoryTool() portal_categories = self.getCategoryTool()
person_module = self.getPersonModule()
bc = self.base_cat bc = self.base_cat
portal_categories.newContent(portal_type='Base Category',id=bc) portal_categories.newContent(portal_type='Base Category',id=bc)
self.cat1 = portal_categories[bc].newContent(id='1',portal_type='Category') self.cat1 = portal_categories[bc].newContent(id='1',portal_type='Category')
...@@ -120,6 +121,8 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -120,6 +121,8 @@ class TestERP5Category(ERP5TypeTestCase):
self.organisation2 = organisation_module.newContent(id='2',portal_type=self.portal_type) self.organisation2 = organisation_module.newContent(id='2',portal_type=self.portal_type)
self.organisation2.immediateReindexObject() self.organisation2.immediateReindexObject()
self.telephone2 = self.organisation2.newContent(id='1',portal_type='Telephone') self.telephone2 = self.organisation2.newContent(id='1',portal_type='Telephone')
self.person = person_module.newContent(portal_type = 'Person')
self.person.immediateReindexObject()
# We have no place to put a Predicate, we will put it in the # We have no place to put a Predicate, we will put it in the
# Organisation Module # Organisation Module
...@@ -202,7 +205,16 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -202,7 +205,16 @@ class TestERP5Category(ERP5TypeTestCase):
portal_categories[self.base_cat]['1'].edit(id='3') portal_categories[self.base_cat]['1'].edit(id='3')
self.failIfDifferentSet(predicate.getMembershipCriterionCategoryList(),self.new_cat_list) self.failIfDifferentSet(predicate.getMembershipCriterionCategoryList(),self.new_cat_list)
def test_06(self, quiet=0, run=run_all_test):
if not run: return
if not quiet:
self.logMessage('Rename Module With an Object Related to an Object it Contains')
organisation_module = self.getOrganisationModule()
organisation = self.organisation
person = self.person
person.setSubordinationValue(organisation)
organisation_module.edit(id='new_id')
self.assertEquals(person.getSubordinationValue(),organisation)
if __name__ == '__main__': if __name__ == '__main__':
......
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