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

update test, accounting lines will be built in started state, not confirmed


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20589 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f3392fc5
...@@ -993,10 +993,6 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -993,10 +993,6 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
def stepClearAccountingModule(self, sequence, **kw) : def stepClearAccountingModule(self, sequence, **kw) :
""" clear the content of accounting module """ """ clear the content of accounting module """
self.tic() # make sure message queue is empty self.tic() # make sure message queue is empty
# cancel accounting transaction to be able to delete them
for transaction in self.getAccountingModule().objectValues() :
self.getPortal().portal_workflow.doActionFor(
transaction, 'cancel_action', wf_id='accounting_workflow')
# delete # delete
self.getAccountingModule().deleteContent( self.getAccountingModule().deleteContent(
list(self.getAccountingModule().objectIds())) list(self.getAccountingModule().objectIds()))
...@@ -1185,8 +1181,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1185,8 +1181,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
self.assertEquals(invoice.getSimulationState(), 'planned') self.assertEquals(invoice.getSimulationState(), 'planned')
def stepConfirmInvoice(self, sequence, **kw) : def stepConfirmInvoice(self, sequence, **kw) :
""" put the invoice in the `confirmed` state, which will """ put the invoice in the `confirmed` state, which does nothing specific,
start the delivery builder """ the delivery builder is invoked when starting the invoice.
"""
invoice = sequence.get('invoice') invoice = sequence.get('invoice')
self.getPortal().portal_workflow.doActionFor( self.getPortal().portal_workflow.doActionFor(
invoice, 'confirm_action', invoice, 'confirm_action',
...@@ -1195,6 +1192,24 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1195,6 +1192,24 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
) )
self.assertEquals(invoice.getSimulationState(), 'confirmed') self.assertEquals(invoice.getSimulationState(), 'confirmed')
def stepCheckNoAccountingLinesBuiltYet(self, sequence, **kw) :
invoice = sequence.get('invoice')
self.assertEquals(0, len(invoice.getMovementList(
portal_type=invoice.getPortalAccountingMovementTypeList())))
def stepStartInvoice(self, sequence, **kw) :
""" put the invoice in the `started` state, which starts the delivery
builder.
"""
invoice = sequence.get('invoice')
self.getPortal().portal_workflow.doActionFor(
invoice, 'start_action',
wf_id = 'accounting_workflow',
skip_period_validation = 1
)
self.assertEquals(invoice.getSimulationState(), 'started')
def stepCheckAccountingLinesCoherantWithSimulation(self, sequence, **kw) : def stepCheckAccountingLinesCoherantWithSimulation(self, sequence, **kw) :
""" checks that accounting lines are created on the sale invoice """ checks that accounting lines are created on the sale invoice
transaction """ transaction """
...@@ -1464,6 +1479,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1464,6 +1479,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepCheckPaymentRuleIsApplied stepCheckPaymentRuleIsApplied
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCoherantWithSimulation stepCheckAccountingLinesCoherantWithSimulation
""", quiet=quiet ) """, quiet=quiet )
...@@ -1492,6 +1510,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1492,6 +1510,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepCreateSimpleSaleInvoice stepCreateSimpleSaleInvoice
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1523,6 +1544,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1523,6 +1544,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepCreateSimpleSaleInvoiceTwoLines stepCreateSimpleSaleInvoiceTwoLines
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1554,6 +1578,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1554,6 +1578,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepCreateSimpleSaleInvoiceTwoCells stepCreateSimpleSaleInvoiceTwoCells
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1591,6 +1618,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1591,6 +1618,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepAddInvoiceLine stepAddInvoiceLine
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1623,6 +1653,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1623,6 +1653,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepEditInvoiceLine stepEditInvoiceLine
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1657,6 +1690,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1657,6 +1690,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepTic stepTic
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1689,6 +1725,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1689,6 +1725,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepAddCellsInInvoiceLine stepAddCellsInInvoiceLine
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet) """, quiet=quiet)
...@@ -1726,6 +1765,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1726,6 +1765,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
""" """
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
...@@ -1761,6 +1803,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1761,6 +1803,9 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
stepPlanInvoice stepPlanInvoice
stepConfirmInvoice stepConfirmInvoice
stepTic stepTic
stepCheckNoAccountingLinesBuiltYet
stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForMultiLineInvoice stepCheckAccountingLinesCreatedForMultiLineInvoice
stepRebuildAndCheckNothingIsCreated stepRebuildAndCheckNothingIsCreated
""", quiet=quiet ) """, quiet=quiet )
......
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