Commit f199ff09 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

set up a business process for payment rule.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32715 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1bb049b5
......@@ -116,12 +116,14 @@ class TestInvoiceMixin(TestPackingListMixin,
'incoterm/%s' % self.cpt_incoterm,
'quantity_unit/%s' % self.unit_piece_quantity_unit,
'quantity_unit/%s' % self.mass_quantity_unit,
'trade_phase/default/payment',
)
def afterSetUp(self):
self.createCategories()
self.validateRules()
self.createBusinessProcess()
self.login()
self.oldMailHost = getattr(self.portal, 'MailHost', None)
if self.oldMailHost is not None:
......@@ -148,6 +150,29 @@ class TestInvoiceMixin(TestPackingListMixin,
transaction.commit()
self.tic()
def createBusinessProcess(self):
business_process_module = self.portal.business_process_module
test_business_process = getattr(business_process_module,
'test_business_process', None)
if test_business_process is None:
test_business_process = business_process_module.newContent(
portal_type='Business Process',
id='test_business_process',
reference='test_business_process',
title='Test Business Process',
version=1)
pay_path = getattr(test_business_process, 'pay', None)
if pay_path is None:
pay_path = test_business_process.newContent(
portal_type='Business Path',
id='pay',
title='Pay',
trade_phase='default/payment',
source='account_module/bank',
destination='account_module/bank')
rule = self.portal.portal_rules.default_payment_rule
rule.setTradePhase('default/payment')
def login(self):
"""login, without manager role"""
uf = self.getPortal().acl_users
......
......@@ -915,6 +915,12 @@ class TestOrderMixin:
destination_payment_value = organisation2['bank'],
source_project_value = project1,
destination_project_value = project2 )
# XXX Specialise should be Trade Condition, not Business Process
# itself here.
business_process = getattr(self.portal.business_process_module,
'test_business_process', None)
if business_process is not None:
order.edit(specialise_value=business_process)
self.failUnless('Site Error' not in order.view())
def stepCheckDeliveryBuilding(self, sequence=None, sequence_list=None, **kw):
......
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