[Erp5-report] r36178 ivan - /erp5/trunk/products/ERP5/tests/testXHTML.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jun 10 08:43:00 CEST 2010


Author: ivan
Date: Thu Jun 10 08:42:59 2010
New Revision: 36178

URL: http://svn.erp5.org?rev=36178&view=rev
Log:
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) 

Modified:
    erp5/trunk/products/ERP5/tests/testXHTML.py

Modified: erp5/trunk/products/ERP5/tests/testXHTML.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testXHTML.py?rev=36178&r1=36177&r2=36178&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testXHTML.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testXHTML.py [utf8] Thu Jun 10 08:42:59 2010
@@ -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):




More information about the Erp5-report mailing list