Commit 90884450 authored by Yusei Tahara's avatar Yusei Tahara

Stop to use unofficial api.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17638 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3bd7b41
......@@ -136,13 +136,6 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# filter content types to add inside Person.
self.getTypesTool().getTypeInfo('Person').filter_content_types = 0
# turn on Person.acquire_local_roles only for test_22_securityReindex.
if str(self).startswith('test_22_securityReindex'):
person = self.getTypesTool().getTypeInfo('Person')
self.person_acquire_local_roles = person.acquire_local_roles
person.acquire_local_roles = True
self.portal.portal_caches.clearAllCache()
def beforeTearDown(self):
get_transaction().abort()
for module in [ self.getPersonModule(),
......@@ -150,8 +143,8 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.getCategoryTool().region ]:
module.manage_delObjects(list(module.objectIds()))
# turn off Person.acquire_local_roles only for test_22_securityReindex.
if str(self).startswith('test_22_securityReindex'):
# set Person.acquire_local_roles back.
if getattr(self, 'person_acquire_local_roles', None) is not None:
self.getTypesTool().getTypeInfo('Person').acquire_local_roles = self.person_acquire_local_roles
self.portal.portal_caches.clearAllCache()
......@@ -1185,9 +1178,16 @@ class TestPropertySheet:
Note: Turn on Person.acquire_local_roles to 0 in afterSetUp.
"""
if not run: return
from AccessControl import getSecurityManager
portal = self.getPortal()
# turn on Person.acquire_local_roles
person = self.getTypesTool().getTypeInfo('Person')
self.person_acquire_local_roles = person.acquire_local_roles
person.acquire_local_roles = True
portal.portal_caches.clearAllCache()
# Make a plain user.
uf = portal.acl_users
uf._doAddUser('yo', '', [], [])
......
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