[Erp5-report] r45188 leonardo - /erp5/trunk/products/ERP5/tests/testConversionInSimulation.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 7 18:56:54 CEST 2011
Author: leonardo
Date: Thu Apr 7 18:56:53 2011
New Revision: 45188
URL: http://svn.erp5.org?rev=45188&view=rev
Log:
Use a business process with business links, needed by incoming change to Simulation Movement to fetch future trade phase by business link
Modified:
erp5/trunk/products/ERP5/tests/testConversionInSimulation.py
Modified: erp5/trunk/products/ERP5/tests/testConversionInSimulation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testConversionInSimulation.py?rev=45188&r1=45187&r2=45188&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testConversionInSimulation.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testConversionInSimulation.py [utf8] Thu Apr 7 18:56:53 2011
@@ -185,8 +185,20 @@ class TestConversionInSimulation(Account
self.portal.portal_workflow.doActionFor(account, 'validate_action')
def createBusinessProcess(self, resource=None):
- self.business_process = business_process = \
- self.portal.business_process_module.newContent()
+ module = self.portal.business_process_module
+ name = self.__class__.__name__ + '_' + self._testMethodName
+ self.business_process = business_process = module.newContent(
+ name,
+ reference=name,
+ )
+ # copy business links from the default erp5 Business Process
+ source = module['erp5_default_business_process']
+ business_link_id_list = [obj.getId()
+ for obj in source.objectValues()
+ if obj.getPortalType() == 'Business Link']
+ business_process.manage_pasteObjects(
+ source.manage_copyObjects(business_link_id_list)
+ )
trade_phase = self.getCategoryTool().trade_phase
kw = dict(portal_type='Trade Model Path',
trade_date='trade_phase/default/order')
@@ -254,7 +266,7 @@ class TestConversionInSimulation(Account
x_curr_ex_line.validate()
self.createBusinessProcess(currency)
transaction.commit()
- self.tic()#execute transactio
+ self.tic()#execute transaction
client = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Client',
More information about the Erp5-report
mailing list