diff --git a/cookbook/tests/api/test_api_shopping_recipe.py b/cookbook/tests/api/test_api_shopping_recipe.py index 8f4185cb8..b32f2872f 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 ed1fbf097..070b2b70c 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):