[Erp5-report] r20589 - /erp5/trunk/products/ERP5/tests/testAccountingRules.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 16 18:22:30 CEST 2008
Author: jerome
Date: Wed Apr 16 18:22:29 2008
New Revision: 20589
URL: http://svn.erp5.org?rev=20589&view=rev
Log:
update test, accounting lines will be built in started state, not confirmed
Modified:
erp5/trunk/products/ERP5/tests/testAccountingRules.py
Modified: erp5/trunk/products/ERP5/tests/testAccountingRules.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccountingRules.py?rev=20589&r1=20588&r2=20589&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccountingRules.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccountingRules.py Wed Apr 16 18:22:29 2008
@@ -993,10 +993,6 @@
def stepClearAccountingModule(self, sequence, **kw) :
""" clear the content of accounting module """
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
self.getAccountingModule().deleteContent(
list(self.getAccountingModule().objectIds()))
@@ -1185,8 +1181,9 @@
self.assertEquals(invoice.getSimulationState(), 'planned')
def stepConfirmInvoice(self, sequence, **kw) :
- """ put the invoice in the `confirmed` state, which will
- start the delivery builder """
+ """ put the invoice in the `confirmed` state, which does nothing specific,
+ the delivery builder is invoked when starting the invoice.
+ """
invoice = sequence.get('invoice')
self.getPortal().portal_workflow.doActionFor(
invoice, 'confirm_action',
@@ -1195,6 +1192,24 @@
)
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) :
""" checks that accounting lines are created on the sale invoice
transaction """
@@ -1464,6 +1479,9 @@
stepCheckPaymentRuleIsApplied
stepConfirmInvoice
stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
+ stepTic
stepCheckAccountingLinesCoherantWithSimulation
""", quiet=quiet )
@@ -1492,6 +1510,9 @@
stepCreateSimpleSaleInvoice
stepConfirmInvoice
stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
+ stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
""", quiet=quiet )
@@ -1523,6 +1544,9 @@
stepCreateSimpleSaleInvoiceTwoLines
stepConfirmInvoice
stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
+ stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
""", quiet=quiet )
@@ -1553,6 +1577,9 @@
stepClearAccountingModule
stepCreateSimpleSaleInvoiceTwoCells
stepConfirmInvoice
+ stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
@@ -1590,6 +1617,9 @@
stepTic
stepAddInvoiceLine
stepConfirmInvoice
+ stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
@@ -1623,6 +1653,9 @@
stepEditInvoiceLine
stepConfirmInvoice
stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
+ stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
""", quiet=quiet )
@@ -1656,6 +1689,9 @@
stepDeleteInvoiceLine
stepTic
stepConfirmInvoice
+ stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
@@ -1688,6 +1724,9 @@
stepTic
stepAddCellsInInvoiceLine
stepConfirmInvoice
+ stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
@@ -1726,6 +1765,9 @@
"""
stepConfirmInvoice
stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
+ stepTic
stepCheckAccountingLinesCreatedForSimpleInvoice
stepRebuildAndCheckNothingIsCreated
""", quiet=quiet )
@@ -1760,6 +1802,9 @@
stepCreateMultiLineSaleInvoice
stepPlanInvoice
stepConfirmInvoice
+ stepTic
+ stepCheckNoAccountingLinesBuiltYet
+ stepStartInvoice
stepTic
stepCheckAccountingLinesCreatedForMultiLineInvoice
stepRebuildAndCheckNothingIsCreated
More information about the Erp5-report
mailing list