Commit 1d29d144 authored by Julien Muchembled's avatar Julien Muchembled

Fix removal of addRole in testBusinessTemplate

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29271 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3850a1f0
......@@ -2377,7 +2377,7 @@ class ActionTemplateItem(ObjectTemplateItem):
id_id = is_new_action and 'reference' or 'id'
for action in (is_new_action and obj.getActionInformationList
or obj.listActions)():
if getattr(action, id_id) == value:
if getattr(action, id_id, None) == value:
break
else:
if self.is_bt_for_diff:
......@@ -2449,7 +2449,7 @@ class ActionTemplateItem(ObjectTemplateItem):
container = p.unrestrictedTraverse(path)
container.manage_delObjects([obj.id
for obj in container.getActionInformationList()
if obj.reference in action_dict])
if obj.getReference() in action_dict])
for obj in action_dict.itervalues():
container._importOldAction(obj)
else:
......
......@@ -5034,8 +5034,9 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id)
object_pt.newContent(portal_type='Role Information',
title='Geek Role Definition',
description='A definition with non ascii chars éàè',
role_name_list=('Geek Role Definition',),
role_name_list=('geek_role_definition',),
role_category_list=('group/g1','function/f1'),
role_base_category_script_id='Base Category Script',
role_base_category_list=('group','site'))
......@@ -5063,7 +5064,8 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id')
role, = pt[object_id].getRoleInformationList()
self.assertEqual(['Geek Role Definition'], role.getRoleNameList())
self.assertEqual('Geek Role Definition', role.getTitle())
self.assertEqual(['geek_role_definition'], role.getRoleNameList())
self.assertEqual('A definition with non ascii chars éàè', role.getDescription())
self.assertEqual(['group/g1','function/f1'], role.getRoleCategoryList())
self.assertEqual(['group','site'], role.getRoleBaseCategoryList())
......
......@@ -1372,14 +1372,14 @@ class TestPropertySheet:
portal_type_object = type_tool['Organisation']
def addCustomAction(name,condition):
portal_type_object.newContent(portal_type='Action Information',
id = name,
title = 'Become Geek',
action = 'string:${object_url}/become_geek_action',
condition = condition,
action_permission = 'View',
action_type = 'object_action',
visible = 1,
float_index = 2.0)
reference=name,
title='Become Geek',
action='string:${object_url}/become_geek_action',
condition=condition,
action_permission='View',
action_type='object_action',
visible=1,
float_index=2.0)
addCustomAction('action1','python: here.getDescription()=="foo"')
obj = self.getOrganisationModule().newContent(portal_type='Organisation')
action_tool = self.getPortal().portal_actions
......@@ -2178,8 +2178,8 @@ class TestPropertySheet:
doc = self.portal.person_module.newContent(portal_type='Person')
ti = self.getTypesTool()['Person']
self.assertFalse(hasattr(doc, 'getDestination'))
ti.manage_editProperties(dict(type_base_category_list=
ti.getTypeBaseCategoryList(()) + ['destination']))
ti.edit(type_base_category_list=
ti.getTypeBaseCategoryList(()) + ['destination'])
self.assertTrue(hasattr(doc, 'getDestination'))
def test_aq_reset_on_workflow_chain_change(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