Commit f4de1744 authored by Jérome Perrin's avatar Jérome Perrin

allow to specify the simulation state when creating a movement.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13272 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 62e561b9
......@@ -110,7 +110,8 @@ class AccountingTestCase(ERP5TypeTestCase):
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 @@ class AccountingTestCase(ERP5TypeTestCase):
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
......
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