From becbb2da86c552b4d2f10d403233c71577ee4d2e Mon Sep 17 00:00:00 2001 From: Tom Brennan Date: Thu, 3 Oct 2024 15:42:18 +0000 Subject: [PATCH] move model_dump out of for loop --- .../recipe_migration_tests/test_recipe_migrations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py b/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py index 7d2f09c0302..8236f07bfc2 100644 --- a/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py +++ b/tests/integration_tests/recipe_migration_tests/test_recipe_migrations.py @@ -175,8 +175,9 @@ def test_recipe_migration(api_client: TestClient, unique_user_fn_scoped: TestUse if mig.nutrition_entries: assert recipe.nutrition is not None + nutrition = recipe.nutrition.model_dump(by_alias=True) + for k in mig.nutrition_entries.difference(mig.nutrition_filter): - nutrition = recipe.nutrition.model_dump(by_alias=True) assert k in nutrition and nutrition[k] is not None # TODO: validate other types of content