test: modify existing flush and send_after email tests to add delay to flush
This commit is contained in:
parent
55de855b32
commit
ab6806a876
1 changed files with 6 additions and 2 deletions
|
|
@ -57,7 +57,9 @@ class TestEmail(IntegrationTestCase):
|
|||
def test_send_after(self):
|
||||
self.test_email_queue(send_after=1)
|
||||
from frappe.email.queue import flush
|
||||
from frappe.utils import add_to_date, now_datetime
|
||||
|
||||
with self.freeze_time(add_to_date(now_datetime(), seconds=12)):
|
||||
flush()
|
||||
email_queue = frappe.db.sql("""select name from `tabEmail Queue` where status='Sent'""", as_dict=1)
|
||||
self.assertEqual(len(email_queue), 0)
|
||||
|
|
@ -65,7 +67,9 @@ class TestEmail(IntegrationTestCase):
|
|||
def test_flush(self):
|
||||
self.test_email_queue()
|
||||
from frappe.email.queue import flush
|
||||
from frappe.utils import add_to_date, now_datetime
|
||||
|
||||
with self.freeze_time(add_to_date(now_datetime(), seconds=12)):
|
||||
flush()
|
||||
email_queue = frappe.db.sql("""select name from `tabEmail Queue` where status='Sent'""", as_dict=1)
|
||||
self.assertEqual(len(email_queue), 1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue