Commit c3a5f01b authored by Jérome Perrin's avatar Jérome Perrin

test_accept_quantity_divergence_on_invoice_with_started_packing_list was wrong:

If the packing list is not frozen, it will be divergent, this is normal. In
this case the user will have to adopt prevision on the invoice or on the
packing list to solve this divergence.
Update the test to adopt prevision on the packing list and check that both
packing list and invoice are solved



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25519 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c28d65c4
......@@ -3150,9 +3150,25 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
invoice_line.getDeliveryRelatedValue(portal_type='Simulation Movement'
).getQuantity())
self.assertEquals([], packing_list.getDivergenceList())
self.assertEquals('solved', packing_list.getCausalityState())
# the packing list is divergent, because it is not frozen
self.assertEquals('diverged', packing_list.getCausalityState())
divergence_list = packing_list.getDivergenceList()
self.assertEquals(1, len(divergence_list))
divergence = divergence_list[0]
self.assertEquals('quantity', divergence.tested_property)
# if we adopt prevision on this packing list, both invoice and packing list
# will be solved
for builder in packing_list.getBuilderList():
builder.solveDivergence(packing_list.getRelativeUrl(),
divergence_to_adopt_list=divergence_list)
get_transaction().commit()
self.tic()
self.assertEquals('solved', packing_list.getCausalityState())
self.assertEquals('solved', invoice.getCausalityState())
class TestPurchaseInvoice(TestInvoice, ERP5TypeTestCase):
......
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