Skip to content

(PC-31951)[API] fix: Products subcategories are not everything #4759

(PC-31951)[API] fix: Products subcategories are not everything

(PC-31951)[API] fix: Products subcategories are not everything #4759

GitHub Actions / Pytest Report failed Sep 19, 2024 in 0s

2036 tests run, 2031 passed, 4 skipped, 1 failed.

Annotations

Check failure on line 64 in tests/core/mails/transactional/bookings/booking_expiration_to_beneficiary_test.py

See this annotation in the file changed.

@github-actions github-actions / Pytest Report

tests/core/mails/transactional/bookings/booking_expiration_to_beneficiary_test.py.test_should_get_correct_data_when_expired_bookings_cancelled

ValueError: Events products subcategory can only be one of ['SEANCE_CINE', 'LIVRE_PAPIER', 'SUPPORT_PHYSIQUE_MUSIQUE_CD', 'SUPPORT_PHYSIQUE_MUSIQUE_VINYLE'].
Raw output
tests/core/mails/transactional/bookings/booking_expiration_to_beneficiary_test.py:69: in test_should_get_correct_data_when_expired_bookings_cancelled
    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'].