Commit 508ab05a authored by Jérome Perrin's avatar Jérome Perrin

Add test for security indexing of sub documents.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16523 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7074965e
...@@ -1812,6 +1812,30 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1812,6 +1812,30 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
owner='somebody else')]) owner='somebody else')])
def test_SubDocumentsSecurityIndexing(self):
# make sure indexing of security on sub-documents works as expected
uf = self.getPortal().acl_users
uf._doAddUser('bob', '', ['Member'], [])
obj = self._makeOrganisation(title='The Document')
obj2 = obj.newContent(portal_type='Bank Account')
obj2.manage_addLocalRoles('bob', ['Auditor'])
get_transaction().commit()
self.tic()
PortalTestCase.login(self, 'bob')
self.assertEquals([obj2], [x.getObject() for x in
obj.searchFolder(portal_type='Bank Account')])
# now if we pass the bank account in deleted state, it's no longer returned
# by searchFolder.
# This will work as long as Bank Account are associated to a workflow that
# allow deletion.
obj2.delete()
get_transaction().commit()
self.tic()
self.assertEquals([], [x.getObject() for x in
obj.searchFolder(portal_type='Bank Account')])
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Catalog)) suite.addTest(unittest.makeSuite(TestERP5Catalog))
......
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