Commit cd92f28e authored by Kevin Deldycke's avatar Kevin Deldycke

use 'gender' base category instead of 'group' because ERP5/Document/Persons has changed


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2621 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21ee76db
...@@ -136,7 +136,7 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -136,7 +136,7 @@ class TestCMFCategory(ERP5TypeTestCase):
portal_categories[bc].setAcquisitionAppendValue(0) portal_categories[bc].setAcquisitionAppendValue(0)
portal_categories[bc].setAcquisitionSyncValue(1) portal_categories[bc].setAcquisitionSyncValue(1)
portal_categories[bc].setAcquisitionObjectIdList(['default_career']) portal_categories[bc].setAcquisitionObjectIdList(['default_career'])
for bc in ('group', ): for bc in ('gender', ):
if not hasattr(portal_categories, bc): if not hasattr(portal_categories, bc):
portal_categories.newContent(portal_type='Base Category',id=bc) portal_categories.newContent(portal_type='Base Category',id=bc)
portal_categories[bc].setAcquisitionPortalTypeList("python: []") portal_categories[bc].setAcquisitionPortalTypeList("python: []")
...@@ -159,7 +159,7 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -159,7 +159,7 @@ class TestCMFCategory(ERP5TypeTestCase):
ZopeTestCase._print('\n Test Single Category ') ZopeTestCase._print('\n Test Single Category ')
LOG('Testing... ',0,'testSingleCategory') LOG('Testing... ',0,'testSingleCategory')
o1 = self.getOrganisationModule()._getOb(self.id1) o1 = self.getOrganisationModule()._getOb(self.id1)
LOG('SingleCategory,',0,o1.getGroupRelatedValueList()) LOG('SingleCategory,',0,o1.getGenderRelatedValueList())
p1 = self.getPersonModule()._getOb(self.id1) p1 = self.getPersonModule()._getOb(self.id1)
p1.setRegion(self.region1) p1.setRegion(self.region1)
...@@ -316,11 +316,11 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -316,11 +316,11 @@ class TestCMFCategory(ERP5TypeTestCase):
p1 = self.getPersonModule()._getOb(self.id1) p1 = self.getPersonModule()._getOb(self.id1)
p2 = self.getPersonModule()._getOb(self.id2) p2 = self.getPersonModule()._getOb(self.id2)
o1 = self.getOrganisationModule()._getOb(self.id1) o1 = self.getOrganisationModule()._getOb(self.id1)
self.assertEqual(p1.getGroupValue(),None) self.assertEqual(p1.getGenderValue(),None)
p1.setSubordinationValue(o1) p1.setSubordinationValue(o1)
p1.immediateReindexObject() p1.immediateReindexObject()
o1.immediateReindexObject() # New ZSQLCatalog provides instant uid but does not reindex o1.immediateReindexObject() # New ZSQLCatalog provides instant uid but does not reindex
self.assertEqual(p1.getGroupValue(),o1) self.assertEqual(p1.getGenderValue(),o1)
def test_11_ParentAcquisition(self, quiet=0, run=run_all_test): def test_11_ParentAcquisition(self, quiet=0, run=run_all_test):
# Test if we can use an alternative base category # Test if we can use an alternative base category
...@@ -349,19 +349,19 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -349,19 +349,19 @@ class TestCMFCategory(ERP5TypeTestCase):
p1 = self.getPersonModule()._getOb(self.id1) p1 = self.getPersonModule()._getOb(self.id1)
p2 = self.getPersonModule()._getOb(self.id2) p2 = self.getPersonModule()._getOb(self.id2)
o1 = self.getOrganisationModule()._getOb(self.id1) o1 = self.getOrganisationModule()._getOb(self.id1)
p1.setGroupValue(o1) p1.setGenderValue(o1)
p1.immediateReindexObject() p1.immediateReindexObject()
o1.immediateReindexObject() # New ZSQLCatalog provides instant uid but does not reindex o1.immediateReindexObject() # New ZSQLCatalog provides instant uid but does not reindex
self.tic() # This is required self.tic() # This is required
self.assertEqual(p1.getGroupValue(),o1) self.assertEqual(p1.getGenderValue(),o1)
LOG('we will call getGroupRelatedValueList',0,'...') LOG('we will call getGenderRelatedValueList',0,'...')
self.assertEqual(o1.getGroupRelatedValueList(),[p1]) self.assertEqual(o1.getGenderRelatedValueList(),[p1])
p2.setGroupValue(o1) # reindex implicit p2.setGenderValue(o1) # reindex implicit
p2.immediateReindexObject() p2.immediateReindexObject()
self.tic() self.tic()
self.assertEqual(len(o1.getGroupRelatedValueList()),2) self.assertEqual(len(o1.getGenderRelatedValueList()),2)
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