Commit 9a650b03 authored by Jérome Perrin's avatar Jérome Perrin

The local_roles= test was bad (using unrestrictedCountResults) and incomplete.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13399 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f628047c
......@@ -1581,14 +1581,32 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# if we specify local_roles= it will only returns documents on with bob has
# a local roles
self.assertEquals(1,
len(ctool.unrestrictedSearchResults(title='Object Title',
len(ctool.searchResults(title='Object Title',
local_roles='Assignee')))
self.assertEquals(1,
ctool.unrestrictedCountResults(title='Object Title',
ctool.countResults(title='Object Title',
local_roles='Assignee')[0][0])
# this also work for searchFolder and countFolder
self.assertEquals(1, len(folder.searchFolder(title='Object Title',
local_roles='Assignee')))
self.assertEquals(1, folder.countFolder(title='Object Title',
local_roles='Assignee')[0][0])
# and local_roles can be a list, then this a OR (ie. you must have at least
# one role).
self.assertEquals(1,
len(ctool.searchResults(title='Object Title',
local_roles=['Assignee', 'Auditor'])))
self.assertEquals(1,
ctool.countResults(title='Object Title',
local_roles=['Assignee', 'Auditor'])[0][0])
# this list can also be given in ; form, for worklists URL
self.assertEquals(1,
len(ctool.searchResults(title='Object Title',
local_roles='Assignee;Auditor')))
self.assertEquals(1,
ctool.countResults(title='Object Title',
local_roles='Assignee;Auditor')[0][0])
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