Commit 52cf9034 authored by Jérome Perrin's avatar Jérome Perrin

when importing PortalTypeRoleTemplateItem, the role must be a string


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24675 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 91aab1ce
......@@ -2371,7 +2371,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
xml = parse(file)
xml_type_roles_list = xml.getElementsByTagName('role')
for role in xml_type_roles_list:
id = role.getAttribute('id')
id = role.getAttribute('id').encode('utf_8', 'backslashreplace')
type_role_property_dict = {'id':id}
# uniq
property_list = role.getElementsByTagName('property')
......
......@@ -4970,6 +4970,8 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.assertEquals(('group/g1','function/f1'), role.getCategory())
self.assertEquals(('group','site'), role.getBaseCategory())
self.assertEquals('Base Category Script', role.getBaseCategoryScript())
# role name is a string, not unicode
self.assertTrue(isinstance(role.id, str))
def test_36_CheckPortalTypeRoles(self, quiet=quiet, run=run_all_test):
if not run: return
......
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