Commit c8002284 authored by Julien Muchembled's avatar Julien Muchembled

Allow projects to reuse testXHTML easily for their own BT.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27652 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c77d34e3
......@@ -48,8 +48,18 @@ bt5_base_path = os.environ.get('erp5_tests_bt5_path',
os.path.join(INSTANCE_HOME, 'bt5'))
bootstrap_base_path = os.path.join(INSTANCE_HOME, 'Products', 'ERP5', 'bootstrap')
# dependency order
target_business_templates = (
class TestXHTML(ERP5TypeTestCase):
run_all_test = 1
def getTitle(self):
return "XHTML Test"
@staticmethod
def getBusinessTemplateList():
""" """
return ( # dependency order
'erp5_base',
'erp5_trade',
......@@ -93,19 +103,7 @@ target_business_templates = (
'erp5_project',
'erp5_calendar',
)
class TestXHTML(ERP5TypeTestCase):
run_all_test = 1
def getTitle(self):
return "XHTML Test"
def getBusinessTemplateList(self):
""" """
return target_business_templates
)
def afterSetUp(self):
self.portal = self.getPortal()
......@@ -396,14 +394,12 @@ def testPortalTypeViewRecursivly(validator, module_id, business_template_info,
tested_portal_type_list=tested_portal_type_list)
def addTestMethodDynamically(validator):
def addTestMethodDynamically(validator, target_business_templates):
from Products.ERP5.tests.utils import BusinessTemplateInfoTar
from Products.ERP5.tests.utils import BusinessTemplateInfoDir
business_template_info_list = []
# add erp5_core to the list here but not in the target_business_templates
# list to not return it on getBusinessTemplateList call
for i in ('erp5_core',) + target_business_templates:
for i in target_business_templates:
business_template = os.path.join(bt5_base_path, i)
# Look for business templates, they can be:
......@@ -472,11 +468,13 @@ elif validator_to_use == 'tidy':
else:
validator = TidyValidator(validator_path, show_warnings)
# add the tests
if validator is not None:
addTestMethodDynamically(validator)
def test_suite():
# add the tests
if validator is not None:
# add erp5_core to the list here to not return it
# on getBusinessTemplateList call
addTestMethodDynamically(validator,
('erp5_core',) + TestXHTML.getBusinessTemplateList())
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestXHTML))
return suite
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