Commit 08657d40 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

correct assertions for payment transaction especially in Purchase case.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32830 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8215891f
...@@ -464,6 +464,24 @@ class TestInvoiceMixin(TestPackingListMixin, ...@@ -464,6 +464,24 @@ class TestInvoiceMixin(TestPackingListMixin,
order_root_applied_rule) order_root_applied_rule)
self.assertEquals(total_quantity, movement.getQuantity()) 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): def stepCheckInvoiceBuilding(self, sequence=None, sequence_list=None, **kw):
""" """
checks that the invoice is built with the default_invoice_builder checks that the invoice is built with the default_invoice_builder
...@@ -632,8 +650,12 @@ class TestInvoiceMixin(TestPackingListMixin, ...@@ -632,8 +650,12 @@ class TestInvoiceMixin(TestPackingListMixin,
self.assertEquals(payment_movement.getVariationCategoryList(), \ self.assertEquals(payment_movement.getVariationCategoryList(), \
related_simulation_movement.getVariationCategoryList()) related_simulation_movement.getVariationCategoryList())
# Test acquisition # Test acquisition
self.checkAcquisition(payment_movement, if invoice.getPortalType() == 'Purchase Invoice Transaction':
related_simulation_movement) self.checkMirrorAcquisition(payment_movement,
related_simulation_movement)
else:
self.checkAcquisition(payment_movement,
related_simulation_movement)
# Test delivery ratio # Test delivery ratio
self.assertEquals(related_simulation_movement.getQuantity() /\ self.assertEquals(related_simulation_movement.getQuantity() /\
payment_movement_quantity, \ payment_movement_quantity, \
......
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