Commit 718dc208 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify according to the new simulation hierarchy.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32589 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 804d187b
......@@ -686,10 +686,15 @@ class TestTaxLineOrderSimulation(AccountingBuildTestCase):
portal_type='Simulation Movement')
self.assertEquals(1, len(simulation_movement_list))
level2_applied_rule_list = simulation_movement_list[0].contentValues()
self.assertEquals(2, len(level2_applied_rule_list))
self.assertEquals(1, len(level2_applied_rule_list))
level2_applied_rule = level2_applied_rule_list[0]
simulation_movement_list = level2_applied_rule.contentValues(
portal_type='Simulation Movement')
level3_applied_rule_list = simulation_movement_list[0].contentValues()
self.assertEquals(2, len(level3_applied_rule_list))
# first test the invoice movement, they should have base_contribution set
# correctly
invoice_rule_list = [ar for ar in level2_applied_rule_list if
invoice_rule_list = [ar for ar in level3_applied_rule_list if
ar.getSpecialiseValue().getPortalType() == 'Invoicing Rule']
self.assertEquals(1, len(invoice_rule_list))
invoice_simulation_movement_list = invoice_rule_list[0].contentValues()
......@@ -772,9 +777,9 @@ class TestTaxLineOrderSimulation(AccountingBuildTestCase):
self.assertEquals(2, len(simulation_movement_list))
# line 1
line1_simulation_movement_list = [sm for sm in simulation_movement_list
if sm.getOrderValue() == order_line1]
if sm.getDeliveryValue() == order_line1]
self.assertEquals(1, len(line1_simulation_movement_list))
simulation_movement = line1_simulation_movement_list[0]
simulation_movement = line1_simulation_movement_list[0].contentValues()[0].contentValues()[0]
self.assertEquals(2.0, simulation_movement.getQuantity())
applied_tax_rule_list = [ar for ar in simulation_movement.objectValues()
if ar.getSpecialiseValue().getPortalType() == 'Tax Rule']
......@@ -790,9 +795,9 @@ class TestTaxLineOrderSimulation(AccountingBuildTestCase):
# line 2
line2_simulation_movement_list = [sm for sm in simulation_movement_list
if sm.getOrderValue() == order_line2]
if sm.getDeliveryValue() == order_line2]
self.assertEquals(1, len(line2_simulation_movement_list))
simulation_movement = line2_simulation_movement_list[0]
simulation_movement = line2_simulation_movement_list[0].contentValues()[0].contentValues()[0]
self.assertEquals(7., simulation_movement.getQuantity())
applied_tax_rule_list = [ar for ar in simulation_movement.objectValues()
if ar.getSpecialiseValue().getPortalType() == 'Tax Rule']
......@@ -1168,7 +1173,7 @@ class TestTaxLineInvoiceSimulation(AccountingBuildTestCase):
portal_type='Simulation Movement')
self.assertEquals(2, len(simulation_movement_list))
tax_simulation_movement_list = [m for m in simulation_movement_list
if m.getOrderValue() == tax_line]
if m.getDeliveryValue() == tax_line]
self.assertEquals(1, len(tax_simulation_movement_list))
tax_simulation_movement = tax_simulation_movement_list[0]
self.assertEquals([base_1],
......@@ -1179,7 +1184,7 @@ class TestTaxLineInvoiceSimulation(AccountingBuildTestCase):
tax_simulation_movement.getPriceCurrencyValue())
invoice_simulation_movement_list = [m for m in simulation_movement_list
if m.getOrderValue() == invoice_line]
if m.getDeliveryValue() == invoice_line]
self.assertEquals(1, len(invoice_simulation_movement_list))
invoice_simulation_movement = invoice_simulation_movement_list[0]
self.assertEquals([base_1],
......
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