[Erp5-report] r13905 - /erp5/trunk/products/ERP5/tests/testInvoice.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Apr 3 17:46:43 CEST 2007
Author: alex
Date: Tue Apr 3 17:46:42 2007
New Revision: 13905
URL: http://svn.erp5.org?rev=13905&view=rev
Log:
set base_unit_quantity of the resource, and use it to round the amount of
invoice transaction lines before checking them
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=13905&r1=13904&r2=13905&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInvoice.py (original)
+++ erp5/trunk/products/ERP5/tests/testInvoice.py Tue Apr 3 17:46:42 2007
@@ -162,8 +162,10 @@
currency_module = self.getCurrencyModule()
if len(currency_module.objectValues(id='EUR'))==0:
currency = self.getCurrencyModule().newContent(
- portal_type = 'Currency',
- id = "EUR" )
+ portal_type='Currency',
+ id="EUR",
+ base_unit_quantity=0.01,
+ )
currency = currency_module.objectValues(id='EUR')[0]
sequence.edit(currency = currency)
@@ -588,7 +590,9 @@
break
else:
self.fail('No line found that matches %s' % line_id)
- self.assertEquals(line.getQuantity(), expected_price * line_ratio)
+ resource_precision = line.getResourceValue().getQuantityPrecision()
+ self.assertEquals(round(line.getQuantity(), resource_precision),
+ round(expected_price * line_ratio, resource_precision))
def stepCheckDeliveryRuleForDeferred(
self, sequence=None, sequence_list=None, **kw):
More information about the Erp5-report
mailing list