[FIX] purchase: unfuck rounded float comparison in tests

This commit is contained in:
Raphael Collet
2018-01-03 10:01:33 +01:00
parent 0c1fc0b911
commit c8fa2d581c
+3 -3
View File
@@ -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)