Commit db5d183b authored by Arnaud Fontaine's avatar Arnaud Fontaine

CodingStyleTest: Prepare migration of Invoicing Unit Tests to ZODB Components.

efd71291 added on erp5_invoicing a test dependency on erp5_advanced_invoicing.
However, testRule for example uses erp5_invoicing but not erp5_advanced_invoicing
so this would not work.

Moreover, erp5_{simplified,advanced}_invoicing enhance erp5_invoicing by providing
a container for Invoice Line so to match real world use cases it is better to
have two CodingStyle tests: one checking erp5_invoicing+erp5_simplified_invoicing
and the other one erp5_invoicing+erp5_advanced_invoicing.

Also, fix CodingStyle issues on erp5_advanced_invoicing.
parent b2a1e543
"""This script is called on the Invoice after the delivery builder has created """This script is called on the Invoice after the delivery builder has created
the new Invoice. the new Invoice.
""" """
from Products.ERP5Type.Message import translateString
if related_simulation_movement_path_list is None: if related_simulation_movement_path_list is None:
raise RuntimeError, 'related_simulation_movement_path_list is missing. Update ERP5 Product.' raise RuntimeError, 'related_simulation_movement_path_list is missing. Update ERP5 Product.'
......
erp5_advanced_invoicing
\ No newline at end of file
...@@ -180,6 +180,9 @@ ignored_skin_id_set = { ...@@ -180,6 +180,9 @@ ignored_skin_id_set = {
'PdmZuite_reset', 'PdmZuite_reset',
'PdmZuite_CommonTemplateForRenderjsUi', 'PdmZuite_CommonTemplateForRenderjsUi',
'PdmZuite_checkStockBrowserForRenderjsUi', 'PdmZuite_checkStockBrowserForRenderjsUi',
'AdvancedInvoiceTransaction_postTransactionLineGeneration',
'InvoiceTransaction_jumpToOrder',
'InvoiceTransaction_jumpToPackingList',
} }
# Generic method to check consistency of a skin item # Generic method to check consistency of a skin item
......
...@@ -89,6 +89,17 @@ def test_suite(): ...@@ -89,6 +89,17 @@ def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
tested_business_template = os.environ['TESTED_BUSINESS_TEMPLATE'] tested_business_template = os.environ['TESTED_BUSINESS_TEMPLATE']
if tested_business_template == 'erp5_invoicing':
from Testing import ZopeTestCase
ZopeTestCase._print(
'\nDo nothing: Invoice Line container is defined in '
'erp5_{simplified,advanced}_invoicing so you should run those instead\n')
return suite
tested_business_template_list = [tested_business_template]
if tested_business_template in ('erp5_simplified_invoicing',
'erp5_advanced_invoicing'):
tested_business_template_list.append('erp5_invoicing')
testclass = type( testclass = type(
'CodingStyleTest %s' % tested_business_template, 'CodingStyleTest %s' % tested_business_template,
(CodingStyleTest,), (CodingStyleTest,),
...@@ -102,7 +113,7 @@ def test_suite(): ...@@ -102,7 +113,7 @@ def test_suite():
testXHTML.addTestMethodDynamically( testXHTML.addTestMethodDynamically(
testclass, testclass,
testXHTML.validator, testXHTML.validator,
(tested_business_template,), tested_business_template_list,
expected_failure_list=( expected_failure_list=(
# this view needs VCS preference set (this test suite does not support # this view needs VCS preference set (this test suite does not support
# setting preferences, but this might be a way to fix this). # setting preferences, but this might be a way to fix this).
......
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