[Erp5-report] r13272 - /erp5/trunk/products/ERP5/tests/testAccounting.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 8 10:18:54 CET 2007


Author: jerome
Date: Thu Mar  8 10:18:51 2007
New Revision: 13272

URL: http://svn.erp5.org?rev=13272&view=rev
Log:
allow to specify the simulation state when creating a movement.


Modified:
    erp5/trunk/products/ERP5/tests/testAccounting.py

Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=13272&r1=13271&r2=13272&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Thu Mar  8 10:18:51 2007
@@ -110,7 +110,8 @@
   username = 'username'
 
   @reindex
-  def _makeOne(self, portal_type='Accounting Transaction', lines=None, **kw):
+  def _makeOne(self, portal_type='Accounting Transaction', lines=None,
+               simulation_state='draft', **kw):
     """Creates an accounting transaction, and edit it with kw.
     
     The default settings is for self.section.
@@ -132,6 +133,14 @@
       for line in lines:
         line.setdefault('portal_type', transaction_to_line_mapping[portal_type])
         tr.newContent(**line)
+    if simulation_state == 'planned':
+      tr.plan()
+    elif simulation_state == 'confirmed':
+      tr.confirm()
+    elif simulation_state in ('stopped', 'delivered'):
+      tr.stop()
+      if simulation_state == 'delivered':
+        tr.deliver()
     return tr
 
 




More information about the Erp5-report mailing list