Self hosted FLOSS fitness/workout, nutrition and weight tracker
Fix tests
Roland Geidera979d4c5cd8a
diff --git a/wger/nutrition/tests/test_ingredient.py b/wger/nutrition/tests/test_ingredient.pyindex a78adc703..a3e877b6d 100644--- a/wger/nutrition/tests/test_ingredient.py+++ b/wger/nutrition/tests/test_ingredient.py@@ -463,24 +463,21 @@ class IngredientModelTestCase(WgerTestCase):def setUp(self):super().setUp()self.off_response = {- 'status': OFF_SEARCH_PRODUCT_FOUND,- 'product': {- 'code': '1234',- 'lang': 'de',- 'product_name': 'Foo with chocolate',- 'generic_name': 'Foo with chocolate, 250g package',- 'brands': 'The bar company',- 'editors_tags': ['open food facts', 'MrX'],- 'nutriments': {- 'energy-kcal_100g': 120,- 'proteins_100g': 10,- 'carbohydrates_100g': 20,- 'sugars_100g': 30,- 'fat_100g': 40,- 'saturated-fat_100g': 11,- 'sodium_100g': 5,- 'fiber_100g': None,- },+ 'code': '1234',+ 'lang': 'de',+ 'product_name': 'Foo with chocolate',+ 'generic_name': 'Foo with chocolate, 250g package',+ 'brands': 'The bar company',+ 'editors_tags': ['open food facts', 'MrX'],+ 'nutriments': {+ 'energy-kcal_100g': 120,+ 'proteins_100g': 10,+ 'carbohydrates_100g': 20,+ 'sugars_100g': 30,+ 'fat_100g': 40,+ 'saturated-fat_100g': 11,+ 'sodium_100g': 5,+ 'fiber_100g': None,},}@@ -512,7 +509,7 @@ class IngredientModelTestCase(WgerTestCase):"""Tests creating an ingredient from OFF - name gets truncated"""- self.off_response['product']['product_name'] = """+ self.off_response['product_name'] = """The Shiba Inu (柴犬, Japanese: [ɕiba inɯ]) is a breed of hunting dog from Japan. Asmall-to-medium breed, it is the smallest of the six original and distinct spitzbreeds of dog native to Japan.[1] Its name literally translates to "brushwood dog",@@ -527,7 +524,7 @@ class IngredientModelTestCase(WgerTestCase):"""Tests creating an ingredient from OFF - missing key in nutriments"""- del self.off_response['product']['nutriments']['energy-kcal_100g']+ del self.off_response['nutriments']['energy-kcal_100g']mock_api.return_value = self.off_responseingredient = Ingredient.fetch_ingredient_from_off('1234')@@ -538,7 +535,7 @@ class IngredientModelTestCase(WgerTestCase):"""Tests creating an ingredient from OFF - missing name"""- del self.off_response['product']['product_name']+ del self.off_response['product_name']mock_api.return_value = self.off_responseingredient = Ingredient.fetch_ingredient_from_off('1234')