Commit 5ad30d63 authored by Jérome Perrin's avatar Jérome Perrin

use createAccountingTransaction rather than using step / sequence inside a step


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11232 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1a12f48
...@@ -868,8 +868,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -868,8 +868,7 @@ class TestAccounting(ERP5TypeTestCase):
# destination section only. We could theoritically support it. # destination section only. We could theoritically support it.
# get a new valid transaction # get a new valid transaction
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
expense_account = sequence.get('expense_account') expense_account = sequence.get('expense_account')
for line in transaction.getMovementList() : for line in transaction.getMovementList() :
line.edit( source_value = expense_account, line.edit( source_value = expense_account,
...@@ -934,9 +933,9 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -934,9 +933,9 @@ class TestAccounting(ERP5TypeTestCase):
'stop_action') 'stop_action')
# only one line without account and with a quantity is also refused # only one line without account and with a quantity is also refused
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
transaction.getMovementList()[0].setSource(None) transaction.getMovementList()[0].setSource(None)
transaction.getMovementList()[0].setDestination(None)
self.assertRaises(ValidationFailed, self.assertRaises(ValidationFailed,
self.getWorkflowTool().doActionFor, self.getWorkflowTool().doActionFor,
transaction, transaction,
...@@ -944,8 +943,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -944,8 +943,7 @@ class TestAccounting(ERP5TypeTestCase):
# but if we have a line with 0 quantity on both sides, we can # but if we have a line with 0 quantity on both sides, we can
# validate the transaction and delete this line. # validate the transaction and delete this line.
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
line_count = len(transaction.getMovementList()) line_count = len(transaction.getMovementList())
transaction.newContent( transaction.newContent(
portal_type = self.accounting_transaction_line_portal_type) portal_type = self.accounting_transaction_line_portal_type)
...@@ -955,8 +953,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -955,8 +953,7 @@ class TestAccounting(ERP5TypeTestCase):
# 0 quantity, but a destination asset price => do not delete the # 0 quantity, but a destination asset price => do not delete the
# line # line
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
new_line = transaction.newContent( new_line = transaction.newContent(
portal_type = self.accounting_transaction_line_portal_type) portal_type = self.accounting_transaction_line_portal_type)
self.assertEquals(len(transaction.getMovementList()), 3) self.assertEquals(len(transaction.getMovementList()), 3)
...@@ -988,8 +985,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -988,8 +985,7 @@ class TestAccounting(ERP5TypeTestCase):
# asset price have priority (ie. if asset price is not balanced, # asset price have priority (ie. if asset price is not balanced,
# refuses validation even if quantity is balanced) # refuses validation even if quantity is balanced)
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
line_list = transaction.getMovementList() line_list = transaction.getMovementList()
line_list[0].setDestinationTotalAssetPrice(10) line_list[0].setDestinationTotalAssetPrice(10)
line_list[1].setDestinationTotalAssetPrice(100) line_list[1].setDestinationTotalAssetPrice(100)
...@@ -998,8 +994,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -998,8 +994,7 @@ class TestAccounting(ERP5TypeTestCase):
transaction, transaction,
'stop_action') 'stop_action')
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
line_list = transaction.getMovementList() line_list = transaction.getMovementList()
line_list[0].setSourceTotalAssetPrice(10) line_list[0].setSourceTotalAssetPrice(10)
line_list[1].setSourceTotalAssetPrice(100) line_list[1].setSourceTotalAssetPrice(100)
...@@ -1009,8 +1004,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -1009,8 +1004,7 @@ class TestAccounting(ERP5TypeTestCase):
'stop_action') 'stop_action')
# only asset price needs to be balanced # only asset price needs to be balanced
self.stepCreateValidAccountingTransaction(sequence) transaction = self.createAccountingTransaction()
transaction = sequence.get('transaction')
line_list = transaction.getMovementList() line_list = transaction.getMovementList()
line_list[0].setSourceTotalAssetPrice(100) line_list[0].setSourceTotalAssetPrice(100)
line_list[0].setDestinationTotalAssetPrice(100) line_list[0].setDestinationTotalAssetPrice(100)
......
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