Test the creation uids during a catalog_manageClear


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33170 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a72077f8
......@@ -1970,6 +1970,25 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.assertTrue("TRUNCATE(catalog.uid,2) = '2567.54'" in sql_src or \
'TRUNCATE(`catalog`.`uid`, 2) = 2567.54' in sql_src, sql_src)
def test_56_ActivateDuringClearCatalog(self, quiet=quiet,run=run_all_test):
"""
Create a script in the catalog to generate a uid list
Check the creation some objects, or activities, during a clear
"""
# Add a script to create uid list
catalog = self.getCatalogTool().getSQLCatalog()
script_id = 'z0_zCreateUid'
catalog.manage_addProduct['PythonScripts'].manage_addPythonScript(id = script_id)
body = "context.getPortalObject().portal_ids.generateNewLengthIdList(id_group='text_uid')"
script = catalog._getOb(script_id).ZPythonScript_edit('*args,**kw', body)
sql_clear_catalog = list(catalog.sql_clear_catalog)
sql_clear_catalog.append(script_id)
sql_clear_catalog.sort()
catalog.sql_clear_catalog = tuple(sql_clear_catalog)
# launch the sql_clear_catalog with the script after the drop tables and
# before the recreate tables of catalog
catalog.manage_catalogClear()
def test_SearchOnOwner(self, quiet=quiet, run=run_all_test):
if not run: return
# owner= can be used a search key in the catalog to have all documents for
......
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