[Erp5-report] r26996 - /erp5/trunk/products/ERP5/tests/testInvoice.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu May 14 18:38:31 CEST 2009
Author: luke
Date: Thu May 14 18:38:30 2009
New Revision: 26996
URL: http://svn.erp5.org?rev=26996&view=rev
Log:
- check case of Invoice Rule expand method, when invoice is related to packing list and movements are added in separate transactions - first add, tic, then modify
Modified:
erp5/trunk/products/ERP5/tests/testInvoice.py
Modified: erp5/trunk/products/ERP5/tests/testInvoice.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInvoice.py?rev=26996&r1=26995&r2=26996&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInvoice.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testInvoice.py [utf8] Thu May 14 18:38:30 2009
@@ -2120,6 +2120,24 @@
portal_type=self.invoice_line_portal_type):
self.assertEquals(self.default_quantity + last_delta,
line.getQuantity())
+
+ def stepAddInvoiceLinesManyTransactions(self, sequence=None, sequence_list=[]):
+ """
+ add some invoice and accounting lines to the invoice
+ """
+ invoice = sequence.get('invoice')
+ invoice_line = invoice.newContent(portal_type='Invoice Line')
+ transaction_line_1 = invoice.newContent(portal_type='Sale Invoice Transaction Line')
+ transaction_line_2 = invoice.newContent(portal_type='Sale Invoice Transaction Line')
+ transaction.commit()
+ self.tic()
+ invoice_line.edit(resource_value=sequence.get('resource'), quantity=3,
+ price=555)
+ transaction_line_1.edit(id ='receivable', source='account_module/customer',
+ destination='account_module/supplier', quantity=-1665)
+ transaction_line_2.edit(
+ id='income', source='account_module/sale',
+ destination='account_module/purchase', quantity=1665)
def stepAddInvoiceLines(self, sequence=None, sequence_list=[]):
"""
@@ -3041,6 +3059,38 @@
""")
sequence_list.play(self, quiet=quiet)
+ def test_16a_ManuallyAddedMovementsManyTransactions(self, quiet=quiet):
+ """
+ Checks that adding invoice lines and accounting lines to one invoice
+ generates correct simulation
+
+ In this case checks what is happening, where movements are added in
+ one transaction and edited in another
+ """
+ if not quiet:
+ self.logMessage('Invoice with Manually Added Movements in separate transactions')
+ sequence_list = SequenceList()
+ for base_sequence in (self.PACKING_LIST_DEFAULT_SEQUENCE, ) :
+ sequence_list.addSequenceString(
+ base_sequence +
+ """
+ stepSetReadyPackingList
+ stepTic
+ stepStartPackingList
+ stepCheckInvoicingRule
+ stepTic
+ stepCheckInvoiceBuilding
+ stepRebuildAndCheckNothingIsCreated
+ stepCheckInvoicesConsistency
+ stepAddInvoiceLinesManyTransactions
+ stepTic
+ stepCheckInvoiceIsSolved
+ stepStartInvoice
+ stepTic
+ stepCheckSimulationTrees
+ """)
+ sequence_list.play(self, quiet=quiet)
+
def test_17_ManuallyAddedWrongMovements(self, quiet=quiet, run=RUN_ALL_TESTS):
"""
Checks that adding invoice lines and accounting lines to one invoice
More information about the Erp5-report
mailing list