From 59d0ef7b2a44317a0bdae05c8413b341b0750286 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Mon, 12 Jul 2010 15:28:43 +0000
Subject: [PATCH] override stepCreateOrder() to set a business process as the
 specialise value.

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37061 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testERP5Simulation.py | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/product/ERP5/tests/testERP5Simulation.py b/product/ERP5/tests/testERP5Simulation.py
index d40832f286..f194dbca86 100644
--- a/product/ERP5/tests/testERP5Simulation.py
+++ b/product/ERP5/tests/testERP5Simulation.py
@@ -128,6 +128,39 @@ class TestERP5SimulationMixin(TestInvoiceMixin):
     if new_order_rule.getValidationState() != 'validated':
       new_order_rule.validate()
 
+  def stepCreateOrder(self,sequence=None, sequence_list=None, **kw):
+    """
+      Create a empty order
+    """
+    organisation = sequence.get('organisation')
+    project = sequence.get('project')
+#     person = sequence.get('person')
+    portal = self.getPortal()
+    order_module = portal.getDefaultModule(portal_type=self.order_portal_type)
+    order = order_module.newContent(portal_type=self.order_portal_type)
+    order.edit(
+      title = "Order%s" % order.getId(),
+      specialise='business_process_module/erp5_default_business_process',
+      start_date = self.datetime + 10,
+      stop_date = self.datetime + 20,
+    )
+    if organisation is not None:
+      order.edit(source_value=organisation,
+                 source_section_value=organisation,
+                 destination_value=organisation,
+                 destination_section_value=organisation,
+                 # Added for test Packing List Copy
+                 source_decision_value=organisation,
+                 destination_decision_value=organisation,
+                 source_administration_value=organisation,
+                 destination_administration_value=organisation,
+                 )
+    if project is not None:
+      order.edit(source_project_value=project,
+                 destination_project_value=project,
+                 )
+    sequence.edit( order = order )
+
   def _acceptDecisionQuantity(self, document):
     solver_tool = self.portal.portal_solvers
     solver_process = solver_tool.newSolverProcess(document)
-- 
2.30.9