Commit 8cc180ab authored by Sebastien Robin's avatar Sebastien Robin

try to delete object when we are doing hot reindexing and when we are in the double indexing state

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13530 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fd19105d
...@@ -1413,6 +1413,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1413,6 +1413,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
module = portal.getDefaultModule('Organisation') module = portal.getDefaultModule('Organisation')
self.organisation2 = module.newContent(portal_type='Organisation', self.organisation2 = module.newContent(portal_type='Organisation',
title="GreatTitle2") title="GreatTitle2")
first_deleted_url = self.organisation2.getRelativeUrl()
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
path_list = [self.organisation.getRelativeUrl()] path_list = [self.organisation.getRelativeUrl()]
...@@ -1453,6 +1454,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1453,6 +1454,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
'InventoryModule_reindexMovementList', 'InventoryModule_reindexMovementList',
'immediateReindexObject', 'immediateReindexObject',
'Folder_reindexObjectList', 'Folder_reindexObjectList',
'unindexObject',
'recursiveImmediateReindexObject'))
# try to delete objects in double indexing state
module.manage_delObjects(ids=[self.organisation2.getId()])
self.playActivityList(('immediateReindexObject',
'unindexObject', 'unindexObject',
'recursiveImmediateReindexObject', 'recursiveImmediateReindexObject',
'playBackRecordedObjectList', 'playBackRecordedObjectList',
...@@ -1473,10 +1479,12 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1473,10 +1479,12 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
module.manage_delObjects(ids=[self.next_deleted_organisation.getId()]) module.manage_delObjects(ids=[self.next_deleted_organisation.getId()])
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
self.assertEquals(portal_catalog.getHotReindexingState(),
HOT_REINDEXING_FINISHED_STATE)
path_list = [self.organisation3.getRelativeUrl()] path_list = [self.organisation3.getRelativeUrl()]
self.checkRelativeUrlInSQLPathList(path_list,connection_id=self.new_connection_id) self.checkRelativeUrlInSQLPathList(path_list,connection_id=self.new_connection_id)
self.checkRelativeUrlInSQLPathList(path_list,connection_id=self.original_connection_id) self.checkRelativeUrlInSQLPathList(path_list,connection_id=self.original_connection_id)
path_list = [deleted_url,next_deleted_url] path_list = [first_deleted_url,deleted_url,next_deleted_url]
self.checkRelativeUrlNotInSQLPathList(path_list,connection_id=self.new_connection_id) self.checkRelativeUrlNotInSQLPathList(path_list,connection_id=self.new_connection_id)
self.checkRelativeUrlNotInSQLPathList(path_list,connection_id=self.original_connection_id) self.checkRelativeUrlNotInSQLPathList(path_list,connection_id=self.original_connection_id)
...@@ -1646,3 +1654,13 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1646,3 +1654,13 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.assertEquals([select_], [x.getObject() for x in self.assertEquals([select_], [x.getObject() for x in
ctool(portal_type='Person', title='SELECT')]) ctool(portal_type='Person', title='SELECT')])
if __name__ == '__main__':
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Catalog))
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