diff --git a/product/ERP5/tests/testXHTML.py b/product/ERP5/tests/testXHTML.py
index afbdee4b91b7305f8d361f1ab7498651f6ae82ed..946b015c5051411090dbb4fd387da40539c665a6 100644
--- a/product/ERP5/tests/testXHTML.py
+++ b/product/ERP5/tests/testXHTML.py
@@ -48,64 +48,62 @@ 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 = (
-  'erp5_base',
-  'erp5_trade',
 
-  'erp5_pdf_editor',
-  'erp5_pdf_style',
-  'erp5_pdm',
-  'erp5_accounting',
-  'erp5_invoicing',
-
-  'erp5_apparel',
+class TestXHTML(ERP5TypeTestCase):
 
-##   'erp5_banking_core',
-##   'erp5_banking_cash',
-##   'erp5_banking_check',
-##   'erp5_banking_inventory',
+  run_all_test = 1
 
-  'erp5_budget',
-  'erp5_public_accounting_budget',
+  def getTitle(self):
+    return "XHTML Test"
 
-  'erp5_commerce',
+  @staticmethod
+  def getBusinessTemplateList():
+    """  """
+    return ( # dependency order
+      'erp5_base',
+      'erp5_trade',
 
-  'erp5_consulting',
+      'erp5_pdf_editor',
+      'erp5_pdf_style',
+      'erp5_pdm',
+      'erp5_accounting',
+      'erp5_invoicing',
 
-  'erp5_ingestion',
-  'erp5_ingestion_mysql_innodb_catalog',
-  'erp5_crm',
+      'erp5_apparel',
 
-  'erp5_web',
-  'erp5_dms',
+##    'erp5_banking_core',
+##    'erp5_banking_cash',
+##    'erp5_banking_check',
+##    'erp5_banking_inventory',
 
-  'erp5_forge',
+      'erp5_budget',
+      'erp5_public_accounting_budget',
 
-  'erp5_immobilisation',
+      'erp5_commerce',
 
-  'erp5_item',
+      'erp5_consulting',
 
-  'erp5_mrp',
+      'erp5_ingestion',
+      'erp5_ingestion_mysql_innodb_catalog',
+      'erp5_crm',
 
-  'erp5_payroll',
+      'erp5_web',
+      'erp5_dms',
 
-  'erp5_project',
+      'erp5_forge',
 
-  'erp5_calendar',
-)
+      'erp5_immobilisation',
 
+      'erp5_item',
 
-class TestXHTML(ERP5TypeTestCase):
+      'erp5_mrp',
 
-  run_all_test = 1
+      'erp5_payroll',
 
-  def getTitle(self):
-    return "XHTML Test"
+      'erp5_project',
 
-  def getBusinessTemplateList(self):
-    """  """
-    return target_business_templates
+      'erp5_calendar',
+    )
 
   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