From dadcf2587f574fc33aa2a9dc1147c079166c8143 Mon Sep 17 00:00:00 2001 From: Lukasz Lancucki Date: Fri, 19 Jun 2026 10:30:45 +0100 Subject: [PATCH] test(e2e): create product per media test instead of hardcoded id [MPT-22436] The media service fixtures built their service against the hardcoded product id from e2e_config (catalog.product.id), which had reached its maximum number of media items. MediaService.create then returned 400 Bad Request, failing setup for the sync and async media tests. Point the sync and async media service fixtures at the shared created_product / async_created_product fixtures so each run starts from a freshly created, empty product instead of the shared seeded one. Co-Authored-By: Claude Opus 4.8 --- tests/e2e/catalog/product/media/test_async_media.py | 8 ++++---- tests/e2e/catalog/product/media/test_sync_media.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/catalog/product/media/test_async_media.py b/tests/e2e/catalog/product/media/test_async_media.py index ffdd3599..39ae1e94 100644 --- a/tests/e2e/catalog/product/media/test_async_media.py +++ b/tests/e2e/catalog/product/media/test_async_media.py @@ -6,13 +6,13 @@ @pytest.fixture -def async_media_service(async_mpt_vendor, product_id): - return async_mpt_vendor.catalog.products.media(product_id) +def async_media_service(async_mpt_vendor, async_created_product): + return async_mpt_vendor.catalog.products.media(async_created_product.id) @pytest.fixture -def async_vendor_media_service(async_mpt_vendor, product_id): - return async_mpt_vendor.catalog.products.media(product_id) +def async_vendor_media_service(async_mpt_vendor, async_created_product): + return async_mpt_vendor.catalog.products.media(async_created_product.id) @pytest.fixture diff --git a/tests/e2e/catalog/product/media/test_sync_media.py b/tests/e2e/catalog/product/media/test_sync_media.py index 0794574e..e4c4e8cc 100644 --- a/tests/e2e/catalog/product/media/test_sync_media.py +++ b/tests/e2e/catalog/product/media/test_sync_media.py @@ -6,8 +6,8 @@ @pytest.fixture -def vendor_media_service(mpt_vendor, product_id): - return mpt_vendor.catalog.products.media(product_id) +def vendor_media_service(mpt_vendor, created_product): + return mpt_vendor.catalog.products.media(created_product.id) @pytest.fixture