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):
self.assertEquals(count,
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.
"""
......@@ -331,13 +331,17 @@ class TestWorklist(ERP5TypeTestCase):
current_sql_catalog_local_role_keys
get_transaction().commit()
#
# Test related keys
#
self.logMessage("Test related keys")
self.addWorkflowCataloguedVariable(self.checked_workflow,
'base_category_id')
def test_02_related_key(self, quiet=0, run=run_all_test):
"""
Test related keys
"""
if not run:
return
workflow_tool = self.getWorkflowTool()
self.createManagerAndLogin()
self.logMessage("Create categories")
for base_category, category_list in (
('region', ('somewhere', 'elsewhere')),
('role', ('client', 'supplier'))):
......@@ -345,6 +349,9 @@ class TestWorklist(ERP5TypeTestCase):
for category in category_list:
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',
portal_type=self.checked_portal_type,
base_category_id='region')
......@@ -352,6 +359,7 @@ class TestWorklist(ERP5TypeTestCase):
portal_type=self.checked_portal_type,
base_category_id='role')
document = self.createDocument()
get_transaction().commit()
self.tic()
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