From 7ac2ccd89c2fd7080625e08abfd308c8bb9ccc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 23 Sep 2021 16:00:57 -0400 Subject: [PATCH] SG-24020: Fixes a bug in the schedule test (#250) Reactivates and fixes a broken test. --- tests/test_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index f264fa85..50632216 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -785,7 +785,9 @@ def test_work_schedule(self): end_date_obj = datetime.datetime(2012, 1, 7) project = self.project - user = self.sg.find_one('HumanUser', [['projects', 'is', project]], ['name']) + # We're going to be comparing this value with the value returned from the server, so extract only the type + # and id + user = {"type": self.human_user["type"], "id": self.human_user["id"], "name": self.human_user["name"]} work_schedule = self.sg.work_schedule_read(start_date, end_date, project, user) @@ -842,7 +844,7 @@ def test_work_schedule(self): resp = self.sg.work_schedule_read(start_date, end_date, project, user) work_schedule['2012-01-04'] = {"reason": "USER_EXCEPTION", "working": False, "description": "Artist Holiday"} # FIXME: There seems to be a regresion on the Shotgun server that needs to be fixed. Disabling the test - # self.assertEqual(work_schedule, resp) + self.assertEqual(work_schedule, resp) # For now disable tests that are erroneously failling on some sites to # allow CI to pass until the known issue causing this is resolved.