From 7fde3b5facb7c41a92a2c43991b0c3e47c73363c Mon Sep 17 00:00:00 2001 From: Pierre Charlet Date: Thu, 19 Sep 2024 11:02:42 +0200 Subject: [PATCH] (BSR)[API]fix: Sanity check. Test offer creation without WIP_EAN_CREATION feature activated should succeed without product. --- api/tests/routes/pro/post_draft_offer_test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/tests/routes/pro/post_draft_offer_test.py b/api/tests/routes/pro/post_draft_offer_test.py index 7a0597d939..cf43dc5a7d 100644 --- a/api/tests/routes/pro/post_draft_offer_test.py +++ b/api/tests/routes/pro/post_draft_offer_test.py @@ -58,6 +58,22 @@ def test_created_offer_should_have_is_duo_set_to_true_if_subcategory_is_event_an assert response_dict["isDuo"] == True assert not offer.product + @override_features(WIP_EAN_CREATION=False) + def test_create_offer_cd_or_vinyl_without_product_venue_record_store_should_succeed(self, client): + venue = offerers_factories.VenueFactory(venueTypeCode=VenueTypeCode.RECORD_STORE) + offerer = venue.managingOfferer + offerers_factories.UserOffererFactory(offerer=offerer, user__email="user@example.com") + + data = { + "name": "Celeste", + "subcategoryId": subcategories.SUPPORT_PHYSIQUE_MUSIQUE_CD.id, + "venueId": venue.id, + "extraData": {"gtl_id": "07000000"}, + } + response = client.with_session_auth("user@example.com").post("/offers/draft", json=data) + + assert response.status_code == 201 + def test_created_offer_from_product_should_return_product_id(self, client): venue = offerers_factories.VenueFactory() offerer = venue.managingOfferer