Commit 529650a8 authored by Nicolas Delaby's avatar Nicolas Delaby

Avoid Clear Activities in tearDown, Perform test

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19105 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e12ceef6
...@@ -76,8 +76,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -76,8 +76,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.getCategoryTool().region, self.getCategoryTool().region,
self.getCategoryTool().group ]: self.getCategoryTool().group ]:
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
self.getPortal().portal_activities.manageClearActivities()
get_transaction().commit() get_transaction().commit()
self.tic()
def login(self): def login(self):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
...@@ -1621,6 +1621,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1621,6 +1621,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
ob1 = folder.newContent(title='Object Title') ob1 = folder.newContent(title='Object Title')
ob1.manage_permission('View', ['Member'], 1) ob1.manage_permission('View', ['Member'], 1)
ob2 = folder.newContent(title='Object Title') ob2 = folder.newContent(title='Object Title')
ob2_id = ob2.getId()
ob2.manage_addLocalRoles('bob', ['Assignee']) ob2.manage_addLocalRoles('bob', ['Assignee'])
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
...@@ -1665,12 +1666,17 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1665,12 +1666,17 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
#Test if bob can't see object even if Assignee role (without View permission) is defined on object #Test if bob can't see object even if Assignee role (without View permission) is defined on object
ob1.manage_addLocalRoles('bob', ['Assignee']) ob1.manage_addLocalRoles('bob', ['Assignee'])
ob1.manage_permission('View', ['Assignor'], 0)
ob1.reindexObject()
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
ob1.immediateReindexObject() from AccessControl import getSecurityManager
self.assertEquals(1, user = getSecurityManager().getUser()
len(ctool.searchResults(title='Object Title', self.assertFalse(user.has_permission('View', ob1))
local_roles='Assignee'))) self.assertTrue(user.has_role('Assignee', ob1))
result_list = [r.getId() for r in ctool(title='Object Title', local_roles='Assignee')]
self.assertEquals(1, len(result_list))
self.assertEquals([ob2_id], result_list)
self.assertEquals(1, self.assertEquals(1,
ctool.countResults(title='Object Title', ctool.countResults(title='Object Title',
local_roles='Assignee')[0][0]) local_roles='Assignee')[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