fix(test): test_scheduler.py
This commit is contained in:
parent
cb67d66487
commit
5aaee31c49
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue