Skip to content

(PC-31909)[BO] feat: FF switching BO column names #4786

(PC-31909)[BO] feat: FF switching BO column names

(PC-31909)[BO] feat: FF switching BO column names #4786

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

2653 tests run, 2649 passed, 1 skipped, 3 failed.

Annotations

Check failure on line 99 in tests/routes/backoffice/collective_bookings_test.py

See this annotation in the file changed.

@github-actions github-actions / Pytest Report

tests/routes/backoffice/collective_bookings_test.py.test_list_bookings_without_filter

Failed: 3 queries executed, 2 expected
Captured queries were:
1. SELECT user_session.id AS user_session_id, user_session."userId" AS "user_session_userId", user_session.uuid AS user_session_uuid 
   FROM user_session 
   WHERE user_session."userId" = 803 AND user_session.uuid = b6c0923e-0aa1-42d6-ab6c-000a7bbd50bc
2. SELECT "user".id AS user_id, "user".email AS user_email, "user"."firstName" AS "user_firstName", "user"."lastName" AS "user_lastName", "user".roles AS user_roles, permission_1.id AS permission_1_id, permission_1.name AS permission_1_name, permission_1.category AS permission_1_category, role_1.id AS role_1_id, role_1.name AS role_1_name, backoffice_user_profile_1.id AS backoffice_user_profile_1_id, backoffice_user_profile_1."userId" AS "backoffice_user_profile_1_userId", backoffice_user_profile_1.preferences AS backoffice_user_profile_1_preferences 
   FROM "user" LEFT OUTER JOIN backoffice_user_profile AS backoffice_user_profile_1 ON "user".id = backoffice_user_profile_1."userId" LEFT OUTER JOIN (role_backoffice_profile AS role_backoffice_profile_1 JOIN role AS role_1 ON role_1.id = role_backoffice_profile_1."roleId") ON backoffice_user_profile_1.id = role_backoffice_profile_1."profileId" LEFT OUTER JOIN (role_permission AS role_permission_1 JOIN permission AS permission_1 ON permission_1.id = role_permission_1."permissionId") ON role_1.id = role_permission_1."roleId" 
   WHERE "user".id = 803
3. SELECT feature.name AS feature_name, feature."isActive" AS "feature_isActive" 
   FROM feature
Raw output
tests/routes/backoffice/collective_bookings_test.py:101: in test_list_bookings_without_filter
    with assert_num_queries(self.expected_num_queries - 2):
/usr/local/lib/python3.11/contextlib.py:144: in __exit__
    next(self.gen)
src/pcapi/core/testing.py:82: in assert_num_queries
    pytest.fail(
E   Failed: 3 queries executed, 2 expected
E   Captured queries were:
E   1. SELECT user_session.id AS user_session_id, user_session."userId" AS "user_session_userId", user_session.uuid AS user_session_uuid 
E      FROM user_session 
E      WHERE user_session."userId" = 803 AND user_session.uuid = b6c0923e-0aa1-42d6-ab6c-000a7bbd50bc
E   2. SELECT "user".id AS user_id, "user".email AS user_email, "user"."firstName" AS "user_firstName", "user"."lastName" AS "user_lastName", "user".roles AS user_roles, permission_1.id AS permission_1_id, permission_1.name AS permission_1_name, permission_1.category AS permission_1_category, role_1.id AS role_1_id, role_1.name AS role_1_name, backoffice_user_profile_1.id AS backoffice_user_profile_1_id, backoffice_user_profile_1."userId" AS "backoffice_user_profile_1_userId", backoffice_user_profile_1.preferences AS backoffice_user_profile_1_preferences 
E      FROM "user" LEFT OUTER JOIN backoffice_user_profile AS backoffice_user_profile_1 ON "user".id = backoffice_user_profile_1."userId" LEFT OUTER JOIN (role_backoffice_profile AS role_backoffice_profile_1 JOIN role AS role_1 ON role_1.id = role_backoffice_profile_1."roleId") ON backoffice_user_profile_1.id = role_backoffice_profile_1."profileId" LEFT OUTER JOIN (role_permission AS role_permission_1 JOIN permission AS permission_1 ON permission_1.id = role_permission_1."permissionId") ON role_1.id = role_permission_1."roleId" 
E      WHERE "user".id = 803
E   3. SELECT feature.name AS feature_name, feature."isActive" AS "feature_isActive" 
E      FROM feature

Check failure on line 264 in tests/routes/backoffice/collective_bookings_test.py

See this annotation in the file changed.

@github-actions github-actions / Pytest Report

tests/routes/backoffice/collective_bookings_test.py.test_list_bookings_by_id_not_found

Failed: 4 queries executed, 3 expected
Captured queries were:
1. SELECT user_session.id AS user_session_id, user_session."userId" AS "user_session_userId", user_session.uuid AS user_session_uuid 
   FROM user_session 
   WHERE user_session."userId" = 832 AND user_session.uuid = d035bba3-ce70-4bfd-9bbb-a1c3e9052681
2. SELECT "user".id AS user_id, "user".email AS user_email, "user"."firstName" AS "user_firstName", "user"."lastName" AS "user_lastName", "user".roles AS user_roles, permission_1.id AS permission_1_id, permission_1.name AS permission_1_name, permission_1.category AS permission_1_category, role_1.id AS role_1_id, role_1.name AS role_1_name, backoffice_user_profile_1.id AS backoffice_user_profile_1_id, backoffice_user_profile_1."userId" AS "backoffice_user_profile_1_userId", backoffice_user_profile_1.preferences AS backoffice_user_profile_1_preferences 
   FROM "user" LEFT OUTER JOIN backoffice_user_profile AS backoffice_user_profile_1 ON "user".id = backoffice_user_profile_1."userId" LEFT OUTER JOIN (role_backoffice_profile AS role_backoffice_profile_1 JOIN role AS role_1 ON role_1.id = role_backoffice_profile_1."roleId") ON backoffice_user_profile_1.id = role_backoffice_profile_1."profileId" LEFT OUTER JOIN (role_permission AS role_permission_1 JOIN permission AS permission_1 ON permission_1.id = role_permission_1."permissionId") ON role_1.id = role_permission_1."roleId" 
   WHERE "user".id = 832
3. SELECT anon_1.anon_2_collective_booking_id AS anon_1_anon_2_collective_booking_id, anon_1."anon_2_collective_booking_dateCreated" AS "anon_1_anon_2_collective_booking_dateCreated", anon_1."anon_2_collective_booking_dateUsed" AS "anon_1_anon_2_collective_booking_dateUsed", anon_1."anon_2_collective_booking_collectiveStockId" AS "anon_1_anon_2_collective_booking_collectiveStockId", anon_1."anon_2_collective_booking_venueId" AS "anon_1_anon_2_collective_booking_venueId", anon_1."anon_2_collective_booking_offererId" AS "anon_1_anon_2_collective_booking_offererId", anon_1."anon_2_collective_booking_cancellationDate" AS "anon_1_anon_2_collective_booking_cancellationDate", anon_1."anon_2_collective_booking_cancellationUserId" AS "anon_1_anon_2_collective_booking_cancellationUserId", anon_1."anon_2_collective_booking_cancellationLimitDate" AS "anon_1_anon_2_collective_booking_cancellationLimitDate", anon_1."anon_2_collective_booking_cancellationReason" AS "anon_1_anon_2_collective_booking_cancellationReason", anon_1.anon_2_collective_booking_status AS anon_1_anon_2_collective_booking_status, anon_1."anon_2_collective_booking_reimbursementDate" AS "anon_1_anon_2_collective_booking_reimbursementDate", anon_1."anon_2_collective_booking_educationalInstitutionId" AS "anon_1_anon_2_collective_booking_educationalInstitutionId", anon_1."anon_2_collective_booking_educationalYearId" AS "anon_1_anon_2_collective_booking_educationalYearId", anon_1."anon_2_collective_booking_confirmationDate" AS "anon_1_anon_2_collective_booking_confirmationDate", anon_1."anon_2_collective_booking_confirmationLimitDate" AS "anon_1_anon_2_collective_booking_confirmationLimitDate", anon_1."anon_2_collective_booking_educationalRedactorId" AS "anon_1_anon_2_collective_booking_educationalRedactorId", collective_offer_1.id AS collective_offer_1_id, collective_offer_1.name AS collective_offer_1_name, collective_offer_1.formats AS collective_offer_1_formats, collective_stock_1.id AS collective_stock_1_id, collective_stock_1."beginningDatetime" AS "collective_stock_1_beginningDatetime", collective_stock_1."startDatetime" AS "collective_stock_1_startDatetime", collective_stock_1."endDatetime" AS "collective_stock_1_endDatetime", collective_stock_1."collectiveOfferId" AS "collective_stock_1_collectiveOfferId", collective_stock_1.price AS collective_stock_1_price, collective_stock_1."bookingLimitDatetime" AS "collective_stock_1_bookingLimitDatetime", collective_stock_1."numberOfTickets" AS "collective_stock_1_numberOfTickets", venue_1.id AS venue_1_id, venue_1.name AS venue_1_name, venue_1."managingOffererId" AS "venue_1_managingOffererId", venue_1."publicName" AS "venue_1_publicName", venue_1."isVirtual" AS "venue_1_isVirtual", offerer_1.id AS offerer_1_id, offerer_1.name AS offerer_1_name, educational_institution_1.id AS educational_institution_1_id, educational_institution_1."institutionId" AS "educational_institution_1_institutionId", educational_institution_1."institutionType" AS "educational_institution_1_institutionType", educational_institution_1.name AS educational_institution_1_name, educational_institution_1.city AS educational_institution_1_city, educational_redactor_1.id AS educational_redactor_1_id, educational_redactor_1."firstName" AS "educational_redactor_1_firstName", educational_redactor_1."lastName" AS "educational_redactor_1_lastName", cashflow_batch_1.id AS cashflow_batch_1_id, cashflow_batch_1.label AS cashflow_batch_1_label, cashflow_1.id AS cashflow_1_id, cashflow_1."batchId" AS "cashflow_1_batchId", pricing_1.id AS pricing_1_id, pricing_1.status AS pricing_1_status, pricing_1."creationDate" AS "pricing_1_creationDate", pricing_1.amount AS pricing_1_amount, finance_incident_1.id AS finance_incident_1_id, finance_incident_1.status AS finance_incident_1_status, booking_finance_incident_1.id AS booking_finance_incident_1_id, booking_finance_incident_1."bookingId" AS "booking_finance_incident_1_bookingId", booking_finance_incident_1."collectiveBookingId" AS "booking_finance_incident_1_collectiveBookingId", booking_finance_incident_1."incidentId" AS "booking_finance_incident_1_incidentId", booking_finance_incident_1."beneficiaryId" AS "booking_finance_incident_1_beneficiaryId", booking_finance_incident_1."newTotalAmount" AS "booking_finance_incident_1_newTotalAmount" 
   FROM (SELECT anon_2.collective_booking_id AS anon_2_collective_booking_id, anon_2."collective_booking_dateCreated" AS "anon_2_collective_booking_dateCreated", anon_2."collective_booking_dateUsed" AS "anon_2_collective_booking_dateUsed", anon_2."collective_booking_collectiveStockId" AS "anon_2_collective_booking_collectiveStockId", anon_2."collective_booking_venueId" AS "anon_2_collective_booking_venueId", anon_2."collective_booking_offererId" AS "anon_2_collective_booking_offererId", anon_2."collective_booking_cancellationDate" AS "anon_2_collective_booking_cancellationDate", anon_2."collective_booking_cancellationUserId" AS "anon_2_collective_booking_cancellationUserId", anon_2."collective_booking_cancellationLimitDate" AS "anon_2_collective_booking_cancellationLimitDate", anon_2."collective_booking_cancellationReason" AS "anon_2_collective_booking_cancellationReason", anon_2.collective_booking_status AS anon_2_collective_booking_status, anon_2."collective_booking_reimbursementDate" AS "anon_2_collective_booking_reimbursementDate", anon_2."collective_booking_educationalInstitutionId" AS "anon_2_collective_booking_educationalInstitutionId", anon_2."collective_booking_educationalYearId" AS "anon_2_collective_booking_educationalYearId", anon_2."collective_booking_confirmationDate" AS "anon_2_collective_booking_confirmationDate", anon_2."collective_booking_confirmationLimitDate" AS "anon_2_collective_booking_confirmationLimitDate", anon_2."collective_booking_educationalRedactorId" AS "anon_2_collective_booking_educationalRedactorId" 
   FROM (SELECT collective_booking.id AS collective_booking_id, collective_booking."dateCreated" AS "collective_booking_dateCreated", collective_booking."dateUsed" AS "collective_booking_dateUsed", collective_booking."collectiveStockId" AS "collective_booking_collectiveStockId", collective_booking."venueId" AS "collective_booking_venueId", collective_booking."offererId" AS "collective_booking_offererId", collective_booking."cancellationDate" AS "collective_booking_cancellationDate", collective_booking."cancellationUserId" AS "collective_booking_cancellationUserId", collective_booking."cancellationLimitDate" AS "collective_booking_cancellationLimitDate", collective_booking."cancellationReason" AS "collective_booking_cancellationReason", collective_booking.status AS collective_booking_status, collective_booking."reimbursementDate" AS "collective_booking_reimbursementDate", collective_booking."educationalInstitutionId" AS "collective_booking_educationalInstitutionId", collective_booking."educationalYearId" AS "collective_booking_educationalYearId", collective_booking."confirmationDate" AS "collective_booking_confirmationDate", collective_booking."confirmationLimitDate" AS "collective_booking_confirmationLimitDate", collective_booking."educationalRedactorId" AS "collective_booking_educationalRedactorId" 
   FROM collective_booking JOIN collective_stock ON collective_stock.id = collective_booking."collectiveStockId" JOIN collective_offer ON collective_offer.id = collective_stock."collectiveOfferId" JOIN educational_institution ON educational_institution.id = collective_booking."educationalInstitutionId" 
   WHERE collective_booking.id = 59000 UNION SELECT collective_booking.id AS collective_booking_id, collective_booking."dateCreated" AS "collective_booking_dateCreated", collective_booking."dateUsed" AS "collective_booking_dateUsed", collective_booking."collectiveStockId" AS "collective_booking_collectiveStockId", collective_booking."venueId" AS "collective_booking_venueId", collective_booking."offererId" AS "collective_booking_offererId", collective_booking."cancellationDate" AS "collective_booking_cancellationDate", collective_booking."cancellationUserId" AS "collective_booking_cancellationUserId", collective_booking."cancellationLimitDate" AS "collective_booking_cancellationLimitDate", collective_booking."cancellationReason" AS "collective_booking_cancellationReason", collective_booking.status AS collective_booking_status, collective_booking."reimbursementDate" AS "collective_booking_reimbursementDate", collective_booking."educationalInstitutionId" AS "collective_booking_educationalInstitutionId", collective_booking."educationalYearId" AS "collective_booking_educationalYearId", collective_booking."confirmationDate" AS "collective_booking_confirmationDate", collective_booking."confirmationLimitDate" AS "collective_booking_confirmationLimitDate", collective_booking."educationalRedactorId" AS "collective_booking_educationalRedactorId" 
   FROM collective_booking JOIN collective_stock ON collective_stock.id = collective_booking."collectiveStockId" JOIN collective_offer ON collective_offer.id = collective_stock."collectiveOfferId" JOIN educational_institution ON educational_institution.id = collective_booking."educationalInstitutionId" 
   WHERE collective_offer.id = 59000) AS anon_2 
    LIMIT 101) AS anon_1 LEFT OUTER JOIN collective_stock AS collective_stock_1 ON collective_stock_1.id = anon_1."anon_2_collective_booking_collectiveStockId" LEFT OUTER JOIN collective_offer AS collective_offer_1 ON collective_offer_1.id = collective_stock_1."collectiveOfferId" LEFT OUTER JOIN venue AS venue_1 ON venue_1.id = anon_1."anon_2_collective_booking_venueId" LEFT OUTER JOIN offerer AS offerer_1 ON offerer_1.id = anon_1."anon_2_collective_booking_offererId" LEFT OUTER JOIN educational_institution AS educational_institution_1 ON educational_institution_1.id = anon_1."anon_2_collective_booking_educationalInstitutionId" LEFT OUTER JOIN educational_redactor AS educational_redactor_1 ON educational_redactor_1.id = anon_1."anon_2_collective_booking_educationalRedactorId" LEFT OUTER JOIN pricing AS pricing_1 ON anon_1.anon_2_collective_booking_id = pricing_1."collectiveBookingId" LEFT OUTER JOIN (cashflow_pricing AS cashflow_pricing_1 JOIN cashflow AS cashflow_1 ON cashflow_1.id = cashflow_pricing_1."cashflowId") ON pricing_1.id = cashflow_pricing_1."pricingId" LEFT OUTER JOIN cashflow_batch AS cashflow_batch_1 ON cashflow_batch_1.id = cashflow_1."batchId" LEFT OUTER JOIN booking_finance_incident AS booking_finance_incident_1 ON anon_1.anon_2_collective_booking_id = booking_finance_incident_1."collectiveBookingId" LEFT OUTER JOIN finance_incident AS finance_incident_1 ON finance_incident_1.id = booking_finance_incident_1."incidentId"
4. SELECT feature.name AS feature_name, feature."isActive" AS "feature_isActive" 
   FROM feature
Raw output
tests/routes/backoffice/collective_bookings_test.py:267: in test_list_bookings_by_id_not_found
    with assert_num_queries(self.expected_num_queries - 1):
/usr/local/lib/python3.11/contextlib.py:144: in __exit__
    next(self.gen)
src/pcapi/core/testing.py:82: in assert_num_queries
    pytest.fail(
E   Failed: 4 queries executed, 3 expected
E   Captured queries were:
E   1. SELECT user_session.id AS user_session_id, user_session."userId" AS "user_session_userId", user_session.uuid AS user_session_uuid 
E      FROM user_session 
E      WHERE user_session."userId" = 832 AND user_session.uuid = d035bba3-ce70-4bfd-9bbb-a1c3e9052681
E   2. SELECT "user".id AS user_id, "user".email AS user_email, "user"."firstName" AS "user_firstName", "user"."lastName" AS "user_lastName", "user".roles AS user_roles, permission_1.id AS permission_1_id, permission_1.name AS permission_1_name, permission_1.category AS permission_1_category, role_1.id AS role_1_id, role_1.name AS role_1_name, backoffice_user_profile_1.id AS backoffice_user_profile_1_id, backoffice_user_profile_1."userId" AS "backoffice_user_profile_1_userId", backoffice_user_profile_1.preferences AS backoffice_user_profile_1_preferences 
E      FROM "user" LEFT OUTER JOIN backoffice_user_profile AS backoffice_user_profile_1 ON "user".id = backoffice_user_profile_1."userId" LEFT OUTER JOIN (role_backoffice_profile AS role_backoffice_profile_1 JOIN role AS role_1 ON role_1.id = role_backoffice_profile_1."roleId") ON backoffice_user_profile_1.id = role_backoffice_profile_1."profileId" LEFT OUTER JOIN (role_permission AS role_permission_1 JOIN permission AS permission_1 ON permission_1.id = role_permission_1."permissionId") ON role_1.id = role_permission_1."roleId" 
E      WHERE "user".id = 832
E   3. SELECT anon_1.anon_2_collective_booking_id AS anon_1_anon_2_collective_booking_id, anon_1."anon_2_collective_booking_dateCreated" AS "anon_1_anon_2_collective_booking_dateCreated", anon_1."anon_2_collective_booking_dateUsed" AS "anon_1_anon_2_collective_booking_dateUsed", anon_1."anon_2_collective_booking_collectiveStockId" AS "anon_1_anon_2_collective_booking_collectiveStockId", anon_1."anon_2_collective_booking_venueId" AS "anon_1_anon_2_collective_booking_venueId", anon_1."anon_2_collective_booking_offererId" AS "anon_1_anon_2_collective_booking_offererId", anon_1."anon_2_collective_booking_cancellationDate" AS "anon_1_anon_2_collective_booking_cancellationDate", anon_1."anon_2_collective_booking_cancellationUserId" AS "anon_1_anon_2_collective_booking_cancellationUserId", anon_1."anon_2_collective_booking_cancellationLimitDate" AS "anon_1_anon_2_collective_booking_cancellationLimitDate", anon_1."anon_2_collective_booking_cancellationReason" AS "anon_1_anon_2_collective_booking_cancellationReason", anon_1.anon_2_collective_booking_status AS anon_1_anon_2_collective_booking_status, anon_1."anon_2_collective_booking_reimbursementDate" AS "anon_1_anon_2_collective_booking_reimbursementDate", anon_1."anon_2_collective_booking_educationalInstitutionId" AS "anon_1_anon_2_collective_booking_educationalInstitutionId", anon_1."anon_2_collective_booking_educationalYearId" AS "anon_1_anon_2_collective_booking_educationalYearId", anon_1."anon_2_collective_booking_confirmationDate" AS "anon_1_anon_2_collective_booking_confirmationDate", anon_1."anon_2_collective_booking_confirmationLimitDate" AS "anon_1_anon_2_collective_booking_confirmationLimitDate", anon_1."anon_2_collective_booking_educationalRedactorId" AS "anon_1_anon_2_collective_booking_educationalRedactorId", collective_offer_1.id AS collective_offer_1_id, collective_offer_1.name AS collective_offer_1_name, collective_offer_1.formats AS collective_offer_1_formats, collective_stock_1.id AS collective_stock_1_id, collective_stock_1."beginningDatetime" AS "collective_stock_1_beginningDatetime", collective_stock_1."startDatetime" AS "collective_stock_1_startDatetime", collective_stock_1."endDatetime" AS "collective_stock_1_endDatetime", collective_stock_1."collectiveOfferId" AS "collective_stock_1_collectiveOfferId", collective_stock_1.price AS collective_stock_1_price, collective_stock_1."bookingLimitDatetime" AS "collective_stock_1_bookingLimitDatetime", collective_stock_1."numberOfTickets" AS "collective_stock_1_numberOfTickets", venue_1.id AS venue_1_id, venue_1.name AS venue_1_name, venue_1."managingOffererId" AS "venue_1_managingOffererId", venue_1."publicName" AS "venue_1_publicName", venue_1."isVirtual" AS "venue_1_isVirtual", offerer_1.id AS offerer_1_id, offerer_1.name AS offerer_1_name, educational_institution_1.id AS educational_institution_1_id, educational_institution_1."institutionId" AS "educational_institution_1_institutionId", educational_institution_1."institutionType" AS "educational_institution_1_institutionType", educational_institution_1.name AS educational_institution_1_name, educational_institution_1.city AS educational_institution_1_city, educational_redactor_1.id AS educational_redactor_1_id, educational_redactor_1."firstName" AS "educational_redactor_1_firstName", educational_redactor_1."lastName" AS "educational_redactor_1_lastName", cashflow_batch_1.id AS cashflow_batch_1_id, cashflow_batch_1.label AS cashflow_batch_1_label, cashflow_1.id AS cashflow_1_id, cashflow_1."batchId" AS "cashflow_1_batchId", pricing_1.id AS pricing_1_id, pricing_1.status AS pricing_1_status, pricing_1."creationDate" AS "pricing_1_creationDate", pricing_1.amount AS pricing_1_amount, finance_incident_1.id AS finance_incident_1_id, finance_incident_1.status AS finance_incident_1_status, booking_finance_incident_1.id AS booking_finance_incident_1_id, booking_finance_incident_1."bookingId" AS "booking_finance_incident_1_bookingId", booking_finance_incident_1."collectiveBookingId" AS "booking_finance_incident_1_collectiveBookingId", booking_finance_incident_1."incidentId" AS "booking_finance_incident_1_incidentId", booking_finance_incident_1."beneficiaryId" AS "booking_finance_incident_1_beneficiaryId", booking_finance_incident_1."newTotalAmount" AS "booking_finance_incident_1_newTotalAmount" 
E      FROM (SELECT anon_2.collective_booking_id AS anon_2_collective_booking_id, anon_2."collective_booking_dateCreated" AS "anon_2_collective_booking_dateCreated", anon_2."collective_booking_dateUsed" AS "anon_2_collective_booking_dateUsed", anon_2."collective_booking_collectiveStockId" AS "anon_2_collective_booking_collectiveStockId", anon_2."collective_booking_venueId" AS "anon_2_collective_booking_venueId", anon_2."collective_booking_offererId" AS "anon_2_collective_booking_offererId", anon_2."collective_booking_cancellationDate" AS "anon_2_collective_booking_cancellationDate", anon_2."collective_booking_cancellationUserId" AS "anon_2_collective_booking_cancellationUserId", anon_2."collective_booking_cancellationLimitDate" AS "anon_2_collective_booking_cancellationLimitDate", anon_2."collective_booking_cancellationReason" AS "anon_2_collective_booking_cancellationReason", anon_2.collective_booking_status AS anon_2_collective_booking_status, anon_2."collective_booking_reimbursementDate" AS "anon_2_collective_booking_reimbursementDate", anon_2."collective_booking_educationalInstitutionId" AS "anon_2_collective_booking_educationalInstitutionId", anon_2."collective_booking_educationalYearId" AS "anon_2_collective_booking_educationalYearId", anon_2."collective_booking_confirmationDate" AS "anon_2_collective_booking_confirmationDate", anon_2."collective_booking_confirmationLimitDate" AS "anon_2_collective_booking_confirmationLimitDate", anon_2."collective_booking_educationalRedactorId" AS "anon_2_collective_booking_educationalRedactorId" 
E      FROM (SELECT collective_booking.id AS collective_booking_id, collective_booking."dateCreated" AS "collective_booking_dateCreated", collective_booking."dateUsed" AS "collective_booking_dateUsed", collective_booking."collectiveStockId" AS "collective_booking_collectiveStockId", collective_booking."venueId" AS "collective_booking_venueId", collective_booking."offererId" AS "collective_booking_offererId", collective_booking."cancellationDate" AS "collective_booking_cancellationDate", collective_booking."cancellationUserId" AS "collective_booking_cancellationUserId", collective_booking."cancellationLimitDate" AS "collective_booking_cancellationLimitDate", collective_booking."cancellationReason" AS "collective_booking_cancellationReason", collective_booking.status AS collective_booking_status, collective_booking."reimbursementDate" AS "collective_booking_reimbursementDate", collective_booking."educationalInstitutionId" AS "collective_booking_educationalInstitutionId", collective_booking."educationalYearId" AS "collective_booking_educationalYearId", collective_booking."confirmationDate" AS "collective_booking_confirmationDate", collective_booking."confirmationLimitDate" AS "collective_booking_confirmationLimitDate", collective_booking."educationalRedactorId" AS "collective_booking_educationalRedactorId" 
E      FROM collective_booking JOIN collective_stock ON collective_stock.id = collective_booking."collectiveStockId" JOIN collective_offer ON collective_offer.id = collective_stock."collectiveOfferId" JOIN educational_institution ON educational_institution.id = collective_booking."educationalInstitutionId" 
E      WHERE collective_booking.id = 59000 UNION SELECT collective_booking.id AS collective_booking_id, collective_booking."dateCreated" AS "collective_booking_dateCreated", collective_booking."dateUsed" AS "collective_booking_dateUsed", collective_booking."collectiveStockId" AS "collective_booking_collectiveStockId", collective_booking."venueId" AS "collective_booking_venueId", collective_booking."offererId" AS "collective_booking_offererId", collective_booking."cancellationDate" AS "collective_booking_cancellationDate", collective_booking."cancellationUserId" AS "collective_booking_cancellationUserId", collective_booking."cancellationLimitDate" AS "collective_booking_cancellationLimitDate", collective_booking."cancellationReason" AS "collective_booking_cancellationReason", collective_booking.status AS collective_booking_status, collective_booking."reimbursementDate" AS "collective_booking_reimbursementDate", collective_booking."educationalInstitutionId" AS "collective_booking_educationalInstitutionId", collective_booking."educationalYearId" AS "collective_booking_educationalYearId", collective_booking."confirmationDate" AS "collective_booking_confirmationDate", collective_booking."confirmationLimitDate" AS "collective_booking_confirmationLimitDate", collective_booking."educationalRedactorId" AS "collective_booking_educationalRedactorId" 
E      FROM collective_booking JOIN collective_stock ON collective_stock.id = collective_booking."collectiveStockId" JOIN collective_offer ON collective_offer.id = collective_stock."collectiveOfferId" JOIN educational_institution ON educational_institution.id = collective_booking."educationalInstitutionId" 
E      WHERE collective_offer.id = 59000) AS anon_2 
E       LIMIT 101) AS anon_1 LEFT OUTER JOIN collective_stock AS collective_stock_1 ON collective_stock_1.id = anon_1."anon_2_collective_booking_collectiveStockId" LEFT OUTER JOIN collective_offer AS collective_offer_1 ON collective_offer_1.id = collective_stock_1."collectiveOfferId" LEFT OUTER JOIN venue AS venue_1 ON venue_1.id = anon_1."anon_2_collective_booking_venueId" LEFT OUTER JOIN offerer AS offerer_1 ON offerer_1.id = anon_1."anon_2_collective_booking_offererId" LEFT OUTER JOIN educational_institution AS educational_institution_1 ON educational_institution_1.id = anon_1."anon_2_collective_booking_educationalInstitutionId" LEFT OUTER JOIN educational_redactor AS educational_redactor_1 ON educational_redactor_1.id = anon_1."anon_2_collective_booking_educationalRedactorId" LEFT OUTER JOIN pricing AS pricing_1 ON anon_1.anon_2_collective_booking_id = pricing_1."collectiveBookingId" LEFT OUTER JOIN (cashflow_pricing AS cashflow_pricing_1 JOIN cashflow AS cashflow_1 ON cashflow_1.id = cashflow_pricing_1."cashflowId") ON pricing_1.id = cashflow_pricing_1."pricingId" LEFT OUTER JOIN cashflow_batch AS cashflow_batch_1 ON cashflow_batch_1.id = cashflow_1."batchId" LEFT OUTER JOIN booking_finance_incident AS booking_finance_incident_1 ON anon_1.anon_2_collective_booking_id = booking_finance_incident_1."collectiveBookingId" LEFT OUTER JOIN finance_incident AS finance_incident_1 ON finance_incident_1.id = booking_finance_incident_1."incidentId"
E   4. SELECT feature.name AS feature_name, feature."isActive" AS "feature_isActive" 
E      FROM feature

Check failure on line 391 in tests/routes/backoffice/collective_bookings_test.py

See this annotation in the file changed.

@github-actions github-actions / Pytest Report

tests/routes/backoffice/collective_bookings_test.py.test_list_bookings_with_event_date_before_1900

Failed: 3 queries executed, 2 expected
Captured queries were:
1. SELECT user_session.id AS user_session_id, user_session."userId" AS "user_session_userId", user_session.uuid AS user_session_uuid 
   FROM user_session 
   WHERE user_session."userId" = 851 AND user_session.uuid = abb638db-aa09-4c60-b416-1042079e61d9
2. SELECT "user".id AS user_id, "user".email AS user_email, "user"."firstName" AS "user_firstName", "user"."lastName" AS "user_lastName", "user".roles AS user_roles, permission_1.id AS permission_1_id, permission_1.name AS permission_1_name, permission_1.category AS permission_1_category, role_1.id AS role_1_id, role_1.name AS role_1_name, backoffice_user_profile_1.id AS backoffice_user_profile_1_id, backoffice_user_profile_1."userId" AS "backoffice_user_profile_1_userId", backoffice_user_profile_1.preferences AS backoffice_user_profile_1_preferences 
   FROM "user" LEFT OUTER JOIN backoffice_user_profile AS backoffice_user_profile_1 ON "user".id = backoffice_user_profile_1."userId" LEFT OUTER JOIN (role_backoffice_profile AS role_backoffice_profile_1 JOIN role AS role_1 ON role_1.id = role_backoffice_profile_1."roleId") ON backoffice_user_profile_1.id = role_backoffice_profile_1."profileId" LEFT OUTER JOIN (role_permission AS role_permission_1 JOIN permission AS permission_1 ON permission_1.id = role_permission_1."permissionId") ON role_1.id = role_permission_1."roleId" 
   WHERE "user".id = 851
3. SELECT feature.name AS feature_name, feature."isActive" AS "feature_isActive" 
   FROM feature
Raw output
tests/routes/backoffice/collective_bookings_test.py:397: in test_list_bookings_with_event_date_before_1900
    with assert_num_queries(2):  # user_session + user
/usr/local/lib/python3.11/contextlib.py:144: in __exit__
    next(self.gen)
src/pcapi/core/testing.py:82: in assert_num_queries
    pytest.fail(
E   Failed: 3 queries executed, 2 expected
E   Captured queries were:
E   1. SELECT user_session.id AS user_session_id, user_session."userId" AS "user_session_userId", user_session.uuid AS user_session_uuid 
E      FROM user_session 
E      WHERE user_session."userId" = 851 AND user_session.uuid = abb638db-aa09-4c60-b416-1042079e61d9
E   2. SELECT "user".id AS user_id, "user".email AS user_email, "user"."firstName" AS "user_firstName", "user"."lastName" AS "user_lastName", "user".roles AS user_roles, permission_1.id AS permission_1_id, permission_1.name AS permission_1_name, permission_1.category AS permission_1_category, role_1.id AS role_1_id, role_1.name AS role_1_name, backoffice_user_profile_1.id AS backoffice_user_profile_1_id, backoffice_user_profile_1."userId" AS "backoffice_user_profile_1_userId", backoffice_user_profile_1.preferences AS backoffice_user_profile_1_preferences 
E      FROM "user" LEFT OUTER JOIN backoffice_user_profile AS backoffice_user_profile_1 ON "user".id = backoffice_user_profile_1."userId" LEFT OUTER JOIN (role_backoffice_profile AS role_backoffice_profile_1 JOIN role AS role_1 ON role_1.id = role_backoffice_profile_1."roleId") ON backoffice_user_profile_1.id = role_backoffice_profile_1."profileId" LEFT OUTER JOIN (role_permission AS role_permission_1 JOIN permission AS permission_1 ON permission_1.id = role_permission_1."permissionId") ON role_1.id = role_permission_1."roleId" 
E      WHERE "user".id = 851
E   3. SELECT feature.name AS feature_name, feature."isActive" AS "feature_isActive" 
E      FROM feature