Commit e9b89041 authored by Sebastien Robin's avatar Sebastien Robin

we can not compare floats with Equals, use assertAlmostEquals

This fix errors that could depend on environment (like python
version, mariadb version, etc)
parent 4dde4065
......@@ -1301,12 +1301,14 @@ class TestClosingPeriod(AccountingTestCase):
self.assertEquals(1, q(
"SELECT count(*) FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
self.assertEquals(3.3, q(
self.assertAlmostEquals(3.3, q(
"SELECT total_price FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
self.assertEquals(3.3, q(
"'Balance Transaction Line'")[0][0],
accounting_currency_precision)
self.assertAlmostEquals(3.3, q(
"SELECT quantity FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
"'Balance Transaction Line'")[0][0],
accounting_currency_precision)
self.assertEquals(self.portal.currency_module.euro.getUid(), q(
"SELECT resource_uid FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
......@@ -1438,12 +1440,14 @@ class TestClosingPeriod(AccountingTestCase):
self.assertEquals(1, q(
"SELECT count(*) FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
self.assertEquals(3.3, q(
self.assertAlmostEquals(3.3, q(
"SELECT total_price FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
self.assertEquals(3.3, q(
"'Balance Transaction Line'")[0][0],
accounting_currency_precision)
self.assertAlmostEquals(3.3, q(
"SELECT quantity FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
"'Balance Transaction Line'")[0][0],
accounting_currency_precision)
self.assertEquals(self.portal.currency_module.euro.getUid(), q(
"SELECT resource_uid FROM stock WHERE portal_type="
"'Balance Transaction Line'")[0][0])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment