Commit 113eb79b authored by Julien Muchembled's avatar Julien Muchembled

Add unit test to check dependencies between reindex and unindex activities

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36608 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 96438f46
...@@ -87,5 +87,27 @@ class TestCopySupport(ERP5TypeTestCase): ...@@ -87,5 +87,27 @@ class TestCopySupport(ERP5TypeTestCase):
self.assertTrue(person.getCareerSubordination().startswith('organisation_module')) self.assertTrue(person.getCareerSubordination().startswith('organisation_module'))
self.assertTrue(person.getCareerSubordinationValue().aq_base is organisation.aq_base) self.assertTrue(person.getCareerSubordinationValue().aq_base is organisation.aq_base)
if __name__ == '__main__': def test_02_unindexObjectDependency(self):
unittest.main() # XXX This test passes for bad reasons.
person = self.portal.person_module.newContent(portal_type='Person',
address_city='Lille')
transaction.commit()
self.tic()
person.recursiveReindexObject()
person.default_address.setId('old_address')
person.setAddressCity('Paris')
transaction.commit()
# Currently, the test passes only because ActivityTool.distribute always
# iterates on queues in the same order: SQLQueue before SQLDict.
# If Python returned dictionary values in a different order,
# reindex activities fail with the following error:
# uid of <Products.ERP5Catalog.CatalogTool.IndexableObjectWrapper for
# /erp5/person_module/1/old_address> is 599L and is already assigned
# to deleted in catalog !!! This can be fatal.
# This test would also fail if SQLDict was used for 'unindexObject'.
self.tic()
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestCopySupport))
return suite
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