summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2018-01-03 10:01:05 +0100
committerRaphael Collet <rco@odoo.com>2018-01-03 10:01:33 +0100
commitc8fa2d581caa13e881188552e6e2e22f8e858f7f (patch)
treecb17f81e79a9c0de8a048f9675f7dad107f2a426 /addons
parent0c1fc0b9115ae159584a3e914661c8ece611bd66 (diff)
[FIX] purchase: unfuck rounded float comparison in tests
Diffstat (limited to 'addons')
-rw-r--r--addons/purchase/tests/test_stockvaluation.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/purchase/tests/test_stockvaluation.py b/addons/purchase/tests/test_stockvaluation.py
index 09359417738..453e906d152 100644
--- a/addons/purchase/tests/test_stockvaluation.py
+++ b/addons/purchase/tests/test_stockvaluation.py
@@ -171,7 +171,7 @@ class TestStockValuation(TransactionCase):
# the unit price of the move is the unit price of the purchase order line converted in
# the company's currency
- self.assertEqual(move1.price_unit, price_unit_usd)
+ self.assertAlmostEqual(move1.price_unit, price_unit_usd, places=2)
# change the rate of the currency
self.env['res.currency.rate'].create({
@@ -187,7 +187,7 @@ class TestStockValuation(TransactionCase):
self.assertLess(price_unit_usd_new_rate, price_unit_usd)
# the unit price on the stock move is not directly updated
- self.assertEquals(move1.price_unit, price_unit_usd)
+ self.assertAlmostEqual(move1.price_unit, price_unit_usd, places=2)
# validate the receipt
res_dict = picking1.button_validate()
@@ -195,6 +195,6 @@ class TestStockValuation(TransactionCase):
wizard.process()
# the unit price of the stock move has been updated to the latest value
- self.assertEquals(move1.price_unit, price_unit_usd_new_rate)
+ self.assertAlmostEqual(move1.price_unit, price_unit_usd_new_rate, places=2)
self.assertAlmostEqual(self.product1.stock_value, price_unit_usd_new_rate * 10, delta=0.1)