Commit 29608d83 authored by Mame Coumba Sall's avatar Mame Coumba Sall

add new test to check empty selection names

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26169 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7bb1d54f
...@@ -142,6 +142,23 @@ class TestXHTML(ERP5TypeTestCase): ...@@ -142,6 +142,23 @@ class TestXHTML(ERP5TypeTestCase):
field.get_value('field_id'))) field.get_value('field_id')))
self.assertEquals(error_list, []) self.assertEquals(error_list, [])
def test_emptySelectionNameInListbox(self):
# check all empty selection name in listboxes
skins_tool = self.portal.portal_skins
error_list = []
for form_path, form in skins_tool.ZopeFind(
skins_tool, obj_metatypes=['ERP5 Form'], search_sub=1):
try:
fields = form.get_fields()
except AttributeError, e:
print "%s is broken: %s" % (form_path, e)
for field in fields:
if field.meta_type =='ListBox':
selection_name = field.get_value("selection_name")
if selection_name in ("",None):
error_list.append(form_path)
self.assertEquals(error_list, [])
class W3Validator(object): class W3Validator(object):
def __init__(self, validator_path, show_warnings): def __init__(self, validator_path, show_warnings):
......
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