Commit 207d385a authored by Julien Muchembled's avatar Julien Muchembled

Split testWorklist so that we can easily check if worklists without related...

Split testWorklist so that we can easily check if worklists without related key work with the cache.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24771 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1023052
...@@ -195,7 +195,7 @@ class TestWorklist(ERP5TypeTestCase): ...@@ -195,7 +195,7 @@ class TestWorklist(ERP5TypeTestCase):
self.assertEquals(count, self.assertEquals(count,
self.getWorklistDocumentCountFromActionName(entry_list[0]['name'])) self.getWorklistDocumentCountFromActionName(entry_list[0]['name']))
def test_01_worklist(self, quiet=0, run=run_all_test): def test_01_permission(self, quiet=0, run=run_all_test):
""" """
Test the permission of the building module. Test the permission of the building module.
""" """
...@@ -331,13 +331,17 @@ class TestWorklist(ERP5TypeTestCase): ...@@ -331,13 +331,17 @@ class TestWorklist(ERP5TypeTestCase):
current_sql_catalog_local_role_keys current_sql_catalog_local_role_keys
get_transaction().commit() get_transaction().commit()
# def test_02_related_key(self, quiet=0, run=run_all_test):
# Test related keys """
# Test related keys
self.logMessage("Test related keys") """
self.addWorkflowCataloguedVariable(self.checked_workflow, if not run:
'base_category_id') return
workflow_tool = self.getWorkflowTool()
self.createManagerAndLogin()
self.logMessage("Create categories")
for base_category, category_list in ( for base_category, category_list in (
('region', ('somewhere', 'elsewhere')), ('region', ('somewhere', 'elsewhere')),
('role', ('client', 'supplier'))): ('role', ('client', 'supplier'))):
...@@ -345,6 +349,9 @@ class TestWorklist(ERP5TypeTestCase): ...@@ -345,6 +349,9 @@ class TestWorklist(ERP5TypeTestCase):
for category in category_list: for category in category_list:
newContent(portal_type='Category', id=category) newContent(portal_type='Category', id=category)
self.logMessage("Create worklists using 'base_category_id' related key")
self.addWorkflowCataloguedVariable(self.checked_workflow,
'base_category_id')
self.createWorklist(self.checked_workflow, 'region_worklist', 'has_region', self.createWorklist(self.checked_workflow, 'region_worklist', 'has_region',
portal_type=self.checked_portal_type, portal_type=self.checked_portal_type,
base_category_id='region') base_category_id='region')
...@@ -352,6 +359,7 @@ class TestWorklist(ERP5TypeTestCase): ...@@ -352,6 +359,7 @@ class TestWorklist(ERP5TypeTestCase):
portal_type=self.checked_portal_type, portal_type=self.checked_portal_type,
base_category_id='role') base_category_id='role')
document = self.createDocument()
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
self.clearCache() self.clearCache()
......
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