[Erp5-report] r25519 - /erp5/trunk/products/ERP5/tests/testInvoice.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 10 18:56:21 CET 2009
Author: jerome
Date: Tue Feb 10 18:56:19 2009
New Revision: 25519
URL: http://svn.erp5.org?rev=25519&view=rev
Log:
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
Modified:
erp5/trunk/products/ERP5/tests/testInvoice.py
Modified: erp5/trunk/products/ERP5/tests/testInvoice.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInvoice.py?rev=25519&r1=25518&r2=25519&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInvoice.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testInvoice.py [utf8] Tue Feb 10 18:56:19 2009
@@ -3150,9 +3150,25 @@
invoice_line.getDeliveryRelatedValue(portal_type='Simulation Movement'
).getQuantity())
- self.assertEquals([], packing_list.getDivergenceList())
+ # 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):
More information about the Erp5-report
mailing list