[FIX] purchase: unfuck rounded float comparison in tests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user