Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix test

Roland Geiderf8f37d36bde9
diff --git a/wger/nutrition/models.py b/wger/nutrition/models.py
index 0be8ca4a4..d699b592d 100644
--- a/wger/nutrition/models.py
+++ b/wger/nutrition/models.py
@@ -354,7 +354,9 @@ class Ingredient(AbstractLicenseModel, models.Model):
energy_fat = 0
if self.fat:
- energy_fat = self.fat * ENERGY_FACTOR['fat']['kg']
+ # TODO: for some reason, during the tests the fat value is not
+ # converted to decimal (django 1.9)
+ energy_fat = Decimal(self.fat * ENERGY_FACTOR['fat']['kg'])
energy_calculated = energy_protein + energy_carbohydrates + energy_fat