changed tests to support removed step type

This commit is contained in:
vabene1111 2022-01-18 22:50:02 +01:00
parent 42aaed011c
commit 9e9a61e94e
2 changed files with 1 additions and 3 deletions

View File

@ -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()

View File

@ -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):