diff --git a/frappe/tests/test_scheduler.py b/frappe/tests/test_scheduler.py index 6353f27c99..5c4c95069c 100644 --- a/frappe/tests/test_scheduler.py +++ b/frappe/tests/test_scheduler.py @@ -19,6 +19,7 @@ def test_timeout(): class TestScheduler(TestCase): def setUp(self): frappe.db.set_global('enabled_scheduler_events', "") + frappe.flags.ran_schedulers = [] def test_all_events(self): last = now_datetime() - relativedelta(hours=2) @@ -26,7 +27,8 @@ class TestScheduler(TestCase): self.assertTrue("all" in frappe.flags.ran_schedulers) def test_enabled_events(self): - frappe.flags.enabled_events = ["hourly", "hourly_long", "daily", "daily_long", "weekly", "weekly_long", "monthly", "monthly_long"] + frappe.flags.enabled_events = ["hourly", "hourly_long", "daily", "daily_long", + "weekly", "weekly_long", "monthly", "monthly_long"] # maintain last_event and next_event on the same day last_event = now_datetime().replace(hour=0, minute=0, second=0, microsecond=0) @@ -46,7 +48,8 @@ class TestScheduler(TestCase): frappe.flags.enabled_events = None def test_enabled_events_day_change(self): - val = json.dumps(["daily", "daily_long", "weekly", "weekly_long", "monthly", "monthly_long"]) + val = json.dumps(["daily", "daily_long", "weekly", "weekly_long", + "monthly", "monthly_long"]) frappe.db.set_global('enabled_scheduler_events', val) # maintain last_event and next_event on different days