Commit f39538f0 authored by Romain Courteaud's avatar Romain Courteaud Committed by Kazuhiko Shiozaki

ERP5/tests/testXHTML: do not crash on broken proxy field

parent 05e28e5b
...@@ -41,6 +41,7 @@ from AccessControl import getSecurityManager ...@@ -41,6 +41,7 @@ from AccessControl import getSecurityManager
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import addUserToDeveloperRole, findContentChain from Products.ERP5Type.tests.utils import addUserToDeveloperRole, findContentChain
from Products.ERP5Form.ProxyField import BrokenProxyField
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
# You can invoke same tests in your favourite collection of business templates # You can invoke same tests in your favourite collection of business templates
# by using TestXHTMLMixin like the following : # by using TestXHTMLMixin like the following :
...@@ -106,7 +107,10 @@ class TestXHTMLMixin(ERP5TypeTestCase): ...@@ -106,7 +107,10 @@ class TestXHTMLMixin(ERP5TypeTestCase):
for field_path, field in skins_tool[skin_folder_id].ZopeFind( for field_path, field in skins_tool[skin_folder_id].ZopeFind(
skins_tool[skin_folder_id], skins_tool[skin_folder_id],
obj_metatypes=['ProxyField'], search_sub=1): obj_metatypes=['ProxyField'], search_sub=1):
try:
template_field = field.getTemplateField(cache=False) template_field = field.getTemplateField(cache=False)
except BrokenProxyField:
template_field = None
if template_field is None: if template_field is None:
# Base_viewRelatedObjectList (used for proxy listbox ids on # Base_viewRelatedObjectList (used for proxy listbox ids on
# relation fields) is an exception, the proxy field has no target # relation fields) is an exception, the proxy field has no target
......
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