From c0efe58708fd3d4f3ca5aa761649c3bef14b3fec Mon Sep 17 00:00:00 2001 From: kuzmoyev Date: Tue, 15 Oct 2024 15:58:36 +0200 Subject: [PATCH] Add test for absolute reminder missing fields --- tests/test_reminder.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_reminder.py b/tests/test_reminder.py index 7397875..36dad3b 100644 --- a/tests/test_reminder.py +++ b/tests/test_reminder.py @@ -63,6 +63,17 @@ def test_absolute_reminders_conversion(self): self.assertEqual(reminder.method, 'popup') self.assertEqual(reminder.minutes_before_start, 4 * 24 * 60 + 13 * 60 + 35) + def test_absolute_reminder_conversion_missing_fields(self): + absolute_reminder = PopupReminder(days_before=5, at=time(10, 25)) + absolute_reminder.at = None + with self.assertRaises(ValueError): + absolute_reminder.convert_to_relative(16 / Apr / 2024) + + absolute_reminder = PopupReminder(days_before=5, at=time(10, 25)) + absolute_reminder.days_before = None + with self.assertRaises(ValueError): + absolute_reminder.convert_to_relative(16 / Apr / 2024) + def test_reminder_checks(self): # No time provided with self.assertRaises(ValueError):