-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(PC-32853)[API] feat: fix booking comparison date #14916
base: master
Are you sure you want to change the base?
(PC-32853)[API] feat: fix booking comparison date #14916
Conversation
mypy cop report: 453 (master) ↘ 452 (your branch) Have yourself a merry little break and learn a few facts about the year 452. |
c4b6efb
to
597fd82
Compare
], | ||
) | ||
def test_check_booking_limit_datetime_should_raise_because_booking_limit_is_one_hour_after( | ||
self, stock_factory_function, offer_factory_function, venue_factory_fonction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self, stock_factory_function, offer_factory_function, venue_factory_fonction | |
self, stock_factory, offer_factory, venue_factory |
Pas besoin de préciser le _function
, l'absence de majuscule me semble suffisante.
Je ferai bien même:
self, stock_factory_function, offer_factory_function, venue_factory_fonction | |
self, StockFactory, OfferFactory, VenueFactory |
mais ça va surement faire raler pylint/mypy.
"offer.venue.timezone", | ||
], | ||
) | ||
def test_check_booking_limit_datetime_priorisation_order(self, case): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case
étant un mot clef (switch/case), j'opterai bien pour un nom différent.
pour des questions de lisibilité, plutot que de décrire le cas de test, je mettrai bien directement les variables:
OffererAddressFactory
ouNone
pour la factory"Indian/Reunion"
/ ` "America/Guadeloupe" / ZoneInfo("Europe/Paris") pour la TZ attendue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'ai pourtant voulu être clair. C'est raté
beginning_date = datetime.datetime(2024, 7, 19, 8, tzinfo=datetime.timezone.utc) | ||
booking_limit_date = beginning_date - datetime.timedelta(hours=1) | ||
if case == "offer.offerer_address.address.timezone": | ||
booking_limit_date = beginning_date - datetime.timedelta(hours=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je ne suis pas certain de comprende pourquoi on doit décaler booking_limit_date
597fd82
to
cb4500f
Compare
But de la pull request
Fix [POST] /stock/bulk
Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-32853
lien vers le bug sentry https://sentry.passculture.team/organizations/sentry/issues/1622746/?project=5&referrer=slack
Vérifications