(PC-31951)[API] fix: Products subcategories are not everything #4759
1097 tests run, 1085 passed, 2 skipped, 10 failed.
Annotations
Check failure on line 67 in tests/local_providers/local_provider_test.py
github-actions / Pytest Report
tests/local_providers/local_provider_test.py.test_updates_existing_object
ValueError: Events products subcategory can only be one of ['LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/local_providers/local_provider_test.py:73: in test_updates_existing_object
product = offers_factories.ThingProductFactory(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 90 in tests/local_providers/local_provider_test.py
github-actions / Pytest Report
tests/local_providers/local_provider_test.py.test_does_not_update_existing_object_when_date_is_older_than_last_modified_date
ValueError: Events products subcategory can only be one of ['LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/local_providers/local_provider_test.py:96: in test_does_not_update_existing_object_when_date_is_older_than_last_modified_date
product = offers_factories.ThingProductFactory(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 213 in tests/local_providers/local_provider_test.py
github-actions / Pytest Report
tests/local_providers/local_provider_test.py.test_returns_object_with_expected_attributes
ValueError: Events products subcategory can only be one of ['LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/local_providers/local_provider_test.py:218: in test_returns_object_with_expected_attributes
product = offers_factories.ThingProductFactory(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 123 in tests/scripts/booking/handle_expired_bookings_test.py
github-actions / Pytest Report
tests/scripts/booking/handle_expired_bookings_test.py.test_handle_expired_bookings_should_cancel_expired_individual_bookings
ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/scripts/booking/handle_expired_bookings_test.py:129: in test_handle_expired_bookings_should_cancel_expired_individual_bookings
dvd = ProductFactory(subcategoryId=subcategories.SUPPORT_PHYSIQUE_FILM.id)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 237 in tests/scripts/booking/handle_expired_bookings_test.py
github-actions / Pytest Report
tests/scripts/booking/handle_expired_bookings_test.py.should_notify_of_todays_expired_bookings
ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/scripts/booking/handle_expired_bookings_test.py:243: in should_notify_of_todays_expired_bookings
dvd = ProductFactory(subcategoryId=subcategories.SUPPORT_PHYSIQUE_FILM.id)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 280 in tests/scripts/booking/handle_expired_bookings_test.py
github-actions / Pytest Report
tests/scripts/booking/handle_expired_bookings_test.py.test_should_notify_of_todays_expired_individual_bookings
ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/scripts/booking/handle_expired_bookings_test.py:287: in test_should_notify_of_todays_expired_individual_bookings
dvd = ProductFactory(subcategoryId=subcategories.SUPPORT_PHYSIQUE_FILM.id)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 15 in tests/scripts/booking/notify_soon_to_be_expired_bookings_test.py
github-actions / Pytest Report
tests/scripts/booking/notify_soon_to_be_expired_bookings_test.py.should_call_email_service_for_individual_bookings_which_will_expire_in_7_days
ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/scripts/booking/notify_soon_to_be_expired_bookings_test.py:25: in should_call_email_service_for_individual_bookings_which_will_expire_in_7_days
dvd = ProductFactory(subcategoryId=subcategories.SUPPORT_PHYSIQUE_FILM.id)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 40 in tests/scripts/integration/add_eans_test.py
github-actions / Pytest Report
tests/scripts/integration/add_eans_test.py.test_some_eans_already_exists
failed on setup with "ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE']."
Raw output
tests/scripts/integration/add_eans_test.py:29: in ebooks_fixture
ProductFactory(subcategoryId=subcategories.LIVRE_NUMERIQUE.id, extraData={"ean": eans[0]}),
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 46 in tests/scripts/integration/add_eans_test.py
github-actions / Pytest Report
tests/scripts/integration/add_eans_test.py.test_some_eans_exists_next_to_unrelated_products
failed on setup with "ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE']."
Raw output
tests/scripts/integration/add_eans_test.py:29: in ebooks_fixture
ProductFactory(subcategoryId=subcategories.LIVRE_NUMERIQUE.id, extraData={"ean": eans[0]}),
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Check failure on line 58 in tests/scripts/integration/add_eans_test.py
github-actions / Pytest Report
tests/scripts/integration/add_eans_test.py.test_some_eans_exists_next_to_unrelated_products_without_eans
failed on setup with "ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE']."
Raw output
tests/scripts/integration/add_eans_test.py:29: in ebooks_fixture
ProductFactory(subcategoryId=subcategories.LIVRE_NUMERIQUE.id, extraData={"ean": eans[0]}),
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:43: in __call__
return cls.create(**kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:539: in create
return cls._generate(enums.CREATE_STRATEGY, kwargs)
/home/pcapi/.local/lib/python3.11/site-packages/factory/alchemy.py:60: in _generate
return super()._generate(strategy, params)
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:468: in _generate
return step.build()
/home/pcapi/.local/lib/python3.11/site-packages/factory/builder.py:274: in build
instance = self.factory_meta.instantiate(
/home/pcapi/.local/lib/python3.11/site-packages/factory/base.py:320: in instantiate
return self.factory._create(model, *args, **kwargs)
src/pcapi/core/offers/factories.py:53: in _create
raise ValueError(f"Events products subcategory can only be one of {cls.AVAILABLE_SUBCATEGORIES}.")
E ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].