Commit 3b75430c authored by Julien Muchembled's avatar Julien Muchembled

Fix testERP5eGov

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39709 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 33d88ef7
...@@ -29,7 +29,7 @@ from Globals import InitializeClass ...@@ -29,7 +29,7 @@ from Globals import InitializeClass
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.ERP5Type.Document.PDFTypeInformation import PDFTypeInformation from Products.ERP5.Document.PDFTypeInformation import PDFTypeInformation
from Products.ERP5Type.Core.ActionInformation import CacheableAction from Products.ERP5Type.Core.ActionInformation import CacheableAction
#line count in pdf form of procedure hosting request #line count in pdf form of procedure hosting request
......
...@@ -53,15 +53,9 @@ def allowAccessOnPersonAndOrganisation(self): ...@@ -53,15 +53,9 @@ def allowAccessOnPersonAndOrganisation(self):
'''Add local role on person and organisation to give '''Add local role on person and organisation to give
administrative agent access. administrative agent access.
''' '''
portal_type_list = map(self.getPortalObject().portal_types.getTypeInfo,
('Person', 'Person Module', 'Organisation', 'Organisation Module'))
self.portal = self.getPortalObject()
person_portal_type = self.portal.portal_types.getTypeInfo('Person')
person_module_portal_type = self.portal.portal_types.getTypeInfo('Person Module')
organisation_portal_type = self.portal.portal_types.getTypeInfo('Organisation')
organisation_module_portal_type = self.portal.portal_types.getTypeInfo('Organisation Module')
portal_type_list = (person_portal_type, person_module_portal_type, organisation_portal_type, \
organisation_module_portal_type)
role_category_list = ['role/gouvernement'] role_category_list = ['role/gouvernement']
for ptype in portal_type_list: for ptype in portal_type_list:
role_info_list=[role_info.getTitle() for role_info in ptype.contentValues(portal_type='Role Information')] role_info_list=[role_info.getTitle() for role_info in ptype.contentValues(portal_type='Role Information')]
...@@ -81,10 +75,8 @@ def enableEgovProcedureLogin(self, portal_type): ...@@ -81,10 +75,8 @@ def enableEgovProcedureLogin(self, portal_type):
and subcription forms (citizen, company, agent) and subcription forms (citizen, company, agent)
''' '''
portal = self.getPortalObject() portal = self.getPortalObject()
acl_users = portal.acl_users
def getAclUsers(self):
return getattr(self.getPortalObject(), 'acl_users', None)
acl_users = getAclUsers(self)
erp5security_dispatcher = acl_users.manage_addProduct['ERP5eGovSecurity'] erp5security_dispatcher = acl_users.manage_addProduct['ERP5eGovSecurity']
# add the portal_type in Egov portal_type_list # add the portal_type in Egov portal_type_list
if {'meta_type': 'EGOV User Manager', 'id': 'egov_users'} in \ if {'meta_type': 'EGOV User Manager', 'id': 'egov_users'} in \
...@@ -106,11 +98,7 @@ def setUpEGovSecurityManager(self): ...@@ -106,11 +98,7 @@ def setUpEGovSecurityManager(self):
'''use safi PAS to be able to login organisation''' '''use safi PAS to be able to login organisation'''
portal = self.getPortalObject() portal = self.getPortalObject()
acl_users = portal.acl_users
def getAclUsers(self):
return getattr(self.getPortalObject(), 'acl_users', None)
acl_users = getAclUsers(self)
# Add EGOVUserManager # Add EGOVUserManager
ZopeTestCase.installProduct('ERP5eGovSecurity') ZopeTestCase.installProduct('ERP5eGovSecurity')
......
741 742
\ No newline at end of file \ No newline at end of file
...@@ -910,6 +910,7 @@ class PersistentMigrationMixin(object): ...@@ -910,6 +910,7 @@ class PersistentMigrationMixin(object):
# proceed with migration # proceed with migration
import erp5.portal_type import erp5.portal_type
klass = getattr(erp5.portal_type, portal_type) klass = getattr(erp5.portal_type, portal_type)
assert self.__class__ != klass
self.__class__ = klass self.__class__ = klass
self.__setstate__(value) self.__setstate__(value)
LOG('ERP5Type', TRACE, "Migration for object %s" % self) LOG('ERP5Type', TRACE, "Migration for object %s" % self)
......
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