1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Merge pull request #155 from aavenel/fix-test-rounding

Fix unit test rounding
This commit is contained in:
JocelynDelalande 2017-01-21 14:44:58 +01:00 committed by GitHub
commit 67331dcf2a

View file

@ -498,7 +498,10 @@ class BudgetTestCase(TestCase):
result[models.Project.query.get("raclette").members[0].id] = 8.12
result[models.Project.query.get("raclette").members[1].id] = 0.0
result[models.Project.query.get("raclette").members[2].id] = -8.12
self.assertDictEqual(balance, result)
# Since we're using floating point to store currency, we can have some rounding issues that prevent test from working.
# However, we should obtain the same values as the theorical ones if we round to 2 decimals, like in the UI.
for key, value in balance.iteritems():
self.assertEqual(round(value, 2), result[key])
def test_edit_project(self):
# A project should be editable