Commit 2fb40fb2 authored by Jérome Perrin's avatar Jérome Perrin

This test no longer complain about the number of simulation movements inside the root applied rule when an init script defined on Sale Invoice Transaction Portal Type create some Sale Invoice Transaction Line, they will not be expanded unless site administrator creates a really strange invoice_transaction_rule predicate matrix.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4008 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d303d65c
......@@ -34,7 +34,9 @@ way it is used in the invoice related simulation.
# TODO :
# * test with a Person as destination_section
# * test cancelling / deleting an invoice
# * test payment rule & payment builder
# * test simulation purge when Payment delivered or top level Order cancelled
# * test invoicing rule by connecting to order test.
#
......@@ -1044,9 +1046,19 @@ class TestAccountingRules(ERP5TypeTestCase):
# inside the rule there are simulation movements
simulation_movement_list = applied_rule.contentValues()
# the first one is a mirror of the movement in the invoice line
self.assertEqual( len(simulation_movement_list), 1)
simulation_movement = simulation_movement_list[0]
# this applied rule can also contain movement related to those
# created in the init script, so we only take into account sim.
# movement linked to an invoice line
invoice_line_simulation_movement_list = []
for simulation_movement in simulation_movement_list :
self.assertNotEquals(simulation_movement.getOrderValue(), None)
if simulation_movement.getOrderValue().getPortalType() == \
self.sale_invoice_line_portal_type :
invoice_line_simulation_movement_list.append(simulation_movement)
self.assertEqual( len(invoice_line_simulation_movement_list), 1)
simulation_movement = invoice_line_simulation_movement_list[0]
self.assertEqual( simulation_movement.getPortalType(),
self.simulation_movement_portal_type)
self.assertEqual( invoice_line.getResource(),
......
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