Commit 9fcc4769 authored by Julien Muchembled's avatar Julien Muchembled

Fix TestTradeModelLine.test_01c_PackingListSplitBuildInvoiceBuild

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38424 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eb8db8e4
......@@ -56,7 +56,7 @@
<value> <string>kw[\'parent_specialise_portal_type\'] = [\'Trade Model Rule\', \'Trade Model Simulation Rule\']\n
kw[\'explanation_portal_type\'] = [\'Purchase Order\', \'Purchase Packing List\', \'Purchase Invoice Transaction\', \'Purchase Invoice\']\n
kw[\'portal_type\'] = \'Simulation Movement\'\n
kw[\'grand_parent_simulation_state\'] = [\'started\', \'stopped\', \'delivered\', \'planned\', \'confirmed\']\n
kw[\'grand_parent_simulation_state\'] = [\'started\', \'stopped\', \'delivered\', \'confirmed\']\n
\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
\n
......
......@@ -56,7 +56,7 @@
<value> <string>kw[\'parent_specialise_portal_type\'] = [\'Trade Model Rule\', \'Trade Model Simulation Rule\']\n
kw[\'explanation_portal_type\'] = [\'Sale Order\', \'Sale Packing List\', \'Sale Invoice Transaction\', \'Sale Invoice\']\n
kw[\'portal_type\'] = \'Simulation Movement\'\n
kw[\'grand_parent_simulation_state\'] = [\'started\', \'stopped\', \'delivered\', \'planned\', \'confirmed\']\n
kw[\'grand_parent_simulation_state\'] = [\'started\', \'stopped\', \'delivered\', \'confirmed\']\n
\n
kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
\n
......
......@@ -358,7 +358,7 @@ class TestTradeModelLine(TestTradeModelLineMixin):
total_price = expected_result_dict[use].get(line.getId())
if total_price:
sm = result_dict.pop(use)
self.assertEqual(sm.getTotalPrice(), total_price)
self.assertEqual(str(sm.getTotalPrice()), str(total_price))
self.assertEqual(2, len(sm.getCausalityValueList()))
self.assertEqual(0, len(sm.getCausalityValueList(
portal_type=self.business_link_portal_type)))
......@@ -632,7 +632,8 @@ class TestTradeModelLine(TestTradeModelLineMixin):
invoice_count = len(self.portal
.accounting_module.objectValues(portal_type=self.invoice_portal_type))
self.processPackingListBuildInvoice(packing_list)
# XXX With legacy code, only 1 invoice was built after starting the first
# For some time, the following assertion failed. Here was the reason:
# With legacy code, only 1 invoice was built after starting the first
# packing list. Now, all invoice lines generated by trade model are
# built immediately, creating a second invoice before starting the
# second packing list, and we end up with 3 invoices. In other words,
......@@ -642,7 +643,9 @@ class TestTradeModelLine(TestTradeModelLineMixin):
# invoice is confirmed, the old code does not expand the simulation
# tree completely and SaleInvoice_selectTradeModelMovementList can't
# find any simulation movements related to the second packing list.
expectedFailure(self.assertEqual)(invoice_count + 1, len(self.portal
# This was fixed by removing 'planned' state from
# {Purchase,Sale}Invoice_selectTradeModelMovementList scripts.
self.assertEqual(invoice_count + 1, len(self.portal
.accounting_module.objectValues(portal_type=self.invoice_portal_type)))
self.processPackingListBuildInvoice(new_packing_list)
......
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