From 27857149de05adc97ecb401a08cec3b5742c5fd6 Mon Sep 17 00:00:00 2001 From: Christopher Broderick Date: Tue, 13 May 2025 23:36:50 +0100 Subject: [PATCH] Accommodate "Z" being appended to a datetime string in certain environments. --- helpdesk/tests/test_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helpdesk/tests/test_api.py b/helpdesk/tests/test_api.py index f5ce7dc8..99e0dc11 100644 --- a/helpdesk/tests/test_api.py +++ b/helpdesk/tests/test_api.py @@ -293,7 +293,8 @@ class TicketTest(APITestCase): self.assertEqual(response.status_code, HTTP_201_CREATED) # Check all fields with data returned from the response self.maxDiff = None - # followup_set = response.data.pop("followup_set") + # The date string generated sometimes has a "Z" appended so until they why is figured out... + date_suffix_hack = "Z" if response.data["followup_set"][0]["date"].endswith("Z") else "" self.assertDictEqual( response.data, { @@ -320,7 +321,7 @@ class TicketTest(APITestCase): "new_status": None, "time_spent": None, "followupattachment_set": [], - "date": frozen_date_time_str, + "date": frozen_date_time_str + date_suffix_hack, "message_id": None, } ],