Skip to content

Commit

Permalink
Make occurrence notification tests more reliable
Browse files Browse the repository at this point in the history
By cancelling/rejecting an occurrence that's on a later day, the tests
would now catch the email using the reservation date instead of the
occurrene date.
  • Loading branch information
ThiefMaster committed May 30, 2023
1 parent aadcb07 commit b6ff8de
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion indico/modules/rb/notifications/notifications_test.py
Expand Up @@ -122,7 +122,7 @@ def test_reservation_modification_emails_plaintext(snapshot, snapshot_name, crea
'occurrence_rejection_email_to_manager.txt', 'occurrence_rejection_email_to_user.txt'
))
def test_reservation_occurrence_emails_plaintext(snapshot, snapshot_name, create_reservation):
res = create_reservation(id=0, start_dt=datetime(2022, 11, 11, 13, 37), end_dt=datetime(2022, 11, 12, 14, 37))
res = create_reservation(id=0, start_dt=datetime(2022, 11, 10, 13, 37), end_dt=datetime(2022, 11, 12, 14, 37))
occurrence = {'start_dt': datetime(2022, 11, 11, 13, 37), 'rejection_reason': 'A valid reason!'}
_assert_snapshot(snapshot, snapshot_name, 'reservations', reservation=res, occurrence=occurrence)

Expand Down
Expand Up @@ -5,7 +5,7 @@ You have CANCELLED an occurrence of your booking on Friday 11/11/2022.
Room: 1/2-3
For: Guinea Pig
Reason: Testing
Dates: Friday 11/11/2022 - Saturday 12/11/2022
Dates: Thursday 10/11/2022 - Saturday 12/11/2022
Hours: 13:37 - 14:37

Booking details:
Expand Down
Expand Up @@ -8,7 +8,7 @@ A valid reason!
Room: 1/2-3
For: Guinea Pig
Reason: Testing
Dates: Friday 11/11/2022 - Saturday 12/11/2022
Dates: Thursday 10/11/2022 - Saturday 12/11/2022
Hours: 13:37 - 14:37

You can check the details of the booking here:
Expand Down
Expand Up @@ -8,7 +8,7 @@ A valid reason!
Room: 1/2-3
For: Guinea Pig
Reason: Testing
Dates: Friday 11/11/2022 - Saturday 12/11/2022
Dates: Thursday 10/11/2022 - Saturday 12/11/2022
Hours: 13:37 - 14:37

Booking details:
Expand Down

0 comments on commit b6ff8de

Please sign in to comment.