Commit 82ac37ed authored by Jérome Perrin's avatar Jérome Perrin

finish test for multiple tax lines and multiple order lines


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20517 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 681985ad
...@@ -719,11 +719,28 @@ class TestTaxLineCalculation(TradeConditionTestCase): ...@@ -719,11 +719,28 @@ class TestTaxLineCalculation(TradeConditionTestCase):
line_2.getTotalPrice(), line_2.getTotalPrice(),
line_3.getTotalPrice()]), tax_line_3.getQuantity()) line_3.getTotalPrice()]), tax_line_3.getQuantity())
# TODO: test DeliveryMovement_getCorrespondingTaxLineList
tax_movement_list = line_1.DeliveryMovement_getCorrespondingTaxLineList() tax_movement_list = line_1.DeliveryMovement_getCorrespondingTaxLineList()
self.assertEquals(2, len(tax_movement_list)) self.assertEquals(2, len(tax_movement_list))
tax_1_movement = [m for m in tax_movement_list if m.getPrice() == 0.1][0] tax_1_movement = [m for m in tax_movement_list if m.getPrice() == 0.1][0]
# self.assertEquals( self.assertEquals(tax_1_movement.getQuantity(), 1)
tax_3_movement = [m for m in tax_movement_list if m.getPrice() == 0.3][0]
self.assertEquals(tax_3_movement.getQuantity(), 1)
tax_movement_list = line_2.DeliveryMovement_getCorrespondingTaxLineList()
self.assertEquals(2, len(tax_movement_list))
tax_2_movement = [m for m in tax_movement_list if m.getPrice() == 0.2][0]
self.assertEquals(tax_2_movement.getQuantity(), 4)
tax_3_movement = [m for m in tax_movement_list if m.getPrice() == 0.3][0]
self.assertEquals(tax_3_movement.getQuantity(), 4)
tax_movement_list = line_2.DeliveryMovement_getCorrespondingTaxLineList()
self.assertEquals(3, len(tax_movement_list))
tax_1_movement = [m for m in tax_movement_list if m.getPrice() == 0.1][0]
self.assertEquals(tax_1_movement.getQuantity(), 9)
tax_2_movement = [m for m in tax_movement_list if m.getPrice() == 0.2][0]
self.assertEquals(tax_2_movement.getQuantity(), 9)
tax_3_movement = [m for m in tax_movement_list if m.getPrice() == 0.3][0]
self.assertEquals(tax_3_movement.getQuantity(), 9)
......
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