From f646009290e8b8a35d45da5220fc125809e9a371 Mon Sep 17 00:00:00 2001 From: Charley Cunningham Date: Wed, 25 Oct 2023 21:15:31 -0400 Subject: [PATCH] Add test for unsetting schedule --- backend/tests/plan/test_primary_schedules.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/tests/plan/test_primary_schedules.py b/backend/tests/plan/test_primary_schedules.py index 21fb2b729..a84a4c392 100644 --- a/backend/tests/plan/test_primary_schedules.py +++ b/backend/tests/plan/test_primary_schedules.py @@ -81,6 +81,15 @@ def test_replace_primary_schedule(self): response = self.client.post(primary_schedule_url, {"schedule_id": self.s2.id}) self.assertEqual(response.status_code, 200) self.assert_primary_schedule_id(self.client, self.u1, self.s2.id, num_primary=1) + + def test_unset_primary_schedule(self): + response = self.client.post(primary_schedule_url, {"schedule_id": self.s.id}) + self.assertEqual(response.status_code, 200) + self.assert_primary_schedule_id(self.client, self.u1, self.s.id, num_primary=1) + + response = self.client.post(primary_schedule_url, {"schedule_id": None}) + self.assertEqual(response.status_code, 200) + self.assert_primary_schedule_id(self.client, self.u1, None, num_primary=0) def test_primary_schedule_friends(self): response = self.client.post(primary_schedule_url, {"schedule_id": self.s.id})