Commit 2353ade6 authored by Jérome Perrin's avatar Jérome Perrin

Set destination using category API to prevent automatic setting of the

source.
enable test for other sections (was disabled because of having two test
method with the same name ...)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6172 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2892c807
...@@ -180,6 +180,13 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -180,6 +180,13 @@ class TestAccounting(ERP5TypeTestCase):
self.assertEquals(accounting_period.getSimulationState(), self.assertEquals(accounting_period.getSimulationState(),
'confirmed') 'confirmed')
def stepCheckAccountingPeriodRefusesClosing(self, sequence, **kw):
"""Checks the Accounting Period refuses closing."""
accounting_period = sequence.get('accounting_period')
self.assertRaises(ValidationFailed,
self.getPortal().portal_workflow.doActionFor,
accounting_period, 'confirm_action' )
def stepDeliverAccountingPeriod(self, sequence, **kw): def stepDeliverAccountingPeriod(self, sequence, **kw):
"""Deliver the Accounting Period.""" """Deliver the Accounting Period."""
accounting_period = sequence.get('accounting_period') accounting_period = sequence.get('accounting_period')
...@@ -853,15 +860,17 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -853,15 +860,17 @@ class TestAccounting(ERP5TypeTestCase):
transaction = sequence.get('transaction') 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)
line_count = len(transaction.getMovementList()) self.assertEquals(len(transaction.getMovementList()), 3)
self.failUnless(line_count != 3)
line_list = transaction.getMovementList() line_list = transaction.getMovementList()
line_list[0].setDestinationTotalAssetPrice(100) line_list[0].setDestinationTotalAssetPrice(100)
line_list[0]._setDestination(sequence.get('expense_account')) line_list[0]._setCategoryMembership(
'destination', sequence.get('expense_account').getRelativeUrl())
line_list[1].setDestinationTotalAssetPrice(- 50) line_list[1].setDestinationTotalAssetPrice(- 50)
line_list[1]._setDestination(sequence.get('expense_account')) line_list[1]._setCategoryMembership(
'destination', sequence.get('expense_account').getRelativeUrl())
line_list[2].setDestinationTotalAssetPrice(- 50) line_list[2].setDestinationTotalAssetPrice(- 50)
line_list[2]._setDestination(sequence.get('expense_account')) line_list[2]._setCategoryMembership(
'destination', sequence.get('expense_account').getRelativeUrl())
try: try:
self.getWorkflowTool().doActionFor(transaction, 'stop_action') self.getWorkflowTool().doActionFor(transaction, 'stop_action')
self.assertEquals(transaction.getSimulationState(), 'stopped') self.assertEquals(transaction.getSimulationState(), 'stopped')
...@@ -1051,7 +1060,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -1051,7 +1060,7 @@ class TestAccounting(ERP5TypeTestCase):
stepCheckInvoicesAreDraft stepCheckInvoicesAreDraft
""") """)
def test_AccountingPeriodNotStoppedTransactions(self, quiet=0, def test_AccountingPeriodOtherSections(self, quiet=0,
run=RUN_ALL_TESTS): run=RUN_ALL_TESTS):
"""Accounting Periods does not change other section transactions.""" """Accounting Periods does not change other section transactions."""
if not run : return if not run : return
......
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