From 9e9a61e94ed51a5bae57e878636592c44aad9fc0 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 18 Jan 2022 22:50:02 +0100 Subject: [PATCH] changed tests to support removed step type --- cookbook/tests/api/test_api_shopping_recipe.py | 2 +- cookbook/tests/factories/__init__.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cookbook/tests/api/test_api_shopping_recipe.py b/cookbook/tests/api/test_api_shopping_recipe.py index 8f4185cb..b32f2872 100644 --- a/cookbook/tests/api/test_api_shopping_recipe.py +++ b/cookbook/tests/api/test_api_shopping_recipe.py @@ -200,7 +200,7 @@ def test_shopping_recipe_userpreference(recipe, sle_count, use_mealplan, user2): food = Food.objects.get(id=ingredients[2].food.id) food.onhand_users.add(user) food.save() - food = recipe.steps.filter(type=Step.RECIPE).first().step_recipe.steps.first().ingredients.first().food + food = recipe.steps.exclude(step_recipe=None).first().step_recipe.steps.first().ingredients.first().food food = Food.objects.get(id=food.id) food.onhand_users.add(user) food.save() diff --git a/cookbook/tests/factories/__init__.py b/cookbook/tests/factories/__init__.py index ed1fbf09..070b2b70 100644 --- a/cookbook/tests/factories/__init__.py +++ b/cookbook/tests/factories/__init__.py @@ -269,10 +269,8 @@ class StepFactory(factory.django.DjangoModelFactory): return if kwargs.get('has_recipe', False): self.step_recipe = RecipeFactory(space=self.space) - self.type = Step.RECIPE elif extracted: self.step_recipe = extracted - self.type = Step.RECIPE @factory.post_generation def ingredients(self, create, extracted, **kwargs):