[Erp5-report] r32830 kazuhiko - /erp5/trunk/products/ERP5/tests/testInvoice.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Feb 19 07:28:48 CET 2010
Author: kazuhiko
Date: Fri Feb 19 07:28:47 2010
New Revision: 32830
URL: http://svn.erp5.org?rev=32830&view=rev
Log:
correct assertions for payment transaction especially in Purchase case.
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=32830&r1=32829&r2=32830&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInvoice.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testInvoice.py [utf8] Fri Feb 19 07:28:47 2010
@@ -464,6 +464,24 @@
order_root_applied_rule)
self.assertEquals(total_quantity, movement.getQuantity())
+ def checkMirrorAcquisition(self, object, acquired_object):
+ """
+ Check if properties are well acquired for mirrored case
+ """
+ # packing_list_movement, simulation_movement
+
+ self.assertEquals(acquired_object.getStartDate(), object.getStopDate())
+ self.assertEquals(acquired_object.getStopDate(), object.getStartDate())
+ self.assertEquals(acquired_object.getSourceValue(), \
+ object.getDestinationValue())
+ self.assertEquals(acquired_object.getDestinationValue(), \
+ object.getSourceValue())
+
+ self.assertEquals(acquired_object.getSourceSectionValue(), \
+ object.getDestinationSectionValue())
+ self.assertEquals(acquired_object.getDestinationSectionValue(), \
+ object.getSourceSectionValue())
+
def stepCheckInvoiceBuilding(self, sequence=None, sequence_list=None, **kw):
"""
checks that the invoice is built with the default_invoice_builder
@@ -632,8 +650,12 @@
self.assertEquals(payment_movement.getVariationCategoryList(), \
related_simulation_movement.getVariationCategoryList())
# Test acquisition
- self.checkAcquisition(payment_movement,
- related_simulation_movement)
+ if invoice.getPortalType() == 'Purchase Invoice Transaction':
+ self.checkMirrorAcquisition(payment_movement,
+ related_simulation_movement)
+ else:
+ self.checkAcquisition(payment_movement,
+ related_simulation_movement)
# Test delivery ratio
self.assertEquals(related_simulation_movement.getQuantity() /\
payment_movement_quantity, \
More information about the Erp5-report
mailing list