Commit 3cd7b999 authored by Ivan Tyagov's avatar Ivan Tyagov

List action can be fully qualified name in some cases. Do not raise an error...

List action can be fully qualified name in some cases. Do not raise an error if list action can not be found in current default skin but do exists in another skin folder (we can not reliably check all skin variations) 

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36178 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d35a6e7b
......@@ -265,11 +265,18 @@ class TestXHTML(ERP5TypeTestCase):
if list_action and list_action != 'list': # We assume that 'list'
# list_action exists
if isinstance(list_action, str):
# list_action can be a fully qualified URL, we care for last part of it
list_action = list_action.split('/')[-1].split('?')[0]
try:
list_action = list_action.split('?')[0]
method = self.portal.restrictedTraverse(list_action)
except KeyError:
method = None
if method is None:
# list_action can actually exists but not in current skin, check if it can be found in portal_skins
found_list_action_list = skins_tool.ZopeFind(skins_tool, obj_ids=[list_action], search_sub=1)
if found_list_action_list:
method = found_list_action_list[0][1]
ZopeTestCase._print("List action %s for %s is not part of current skin but do exists in another skin folder.\n" % (list_action, form_path))
else:
method = list_action
if not callable(method):
......
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