From b373f10432cc5be1df2f5922eeae1eaecd227890 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 2 Sep 2020 20:00:36 +0530 Subject: [PATCH] fix: Add sleep to fix test cases --- frappe/email/doctype/notification/test_notification.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frappe/email/doctype/notification/test_notification.py b/frappe/email/doctype/notification/test_notification.py index e370bac9e5..5b8ceb03d4 100644 --- a/frappe/email/doctype/notification/test_notification.py +++ b/frappe/email/doctype/notification/test_notification.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe, frappe.utils, frappe.utils.scheduler from frappe.desk.form import assign_to import unittest +import time test_records = frappe.get_test_records('Notification') @@ -214,6 +215,8 @@ class TestNotification(unittest.TestCase): todo.status = 'Closed' todo.save() + # adding sleep so that email queue is fetched once its created + time.sleep(10) email_queue = frappe.get_doc('Email Queue', {'reference_doctype': 'ToDo', 'reference_name': todo.name}) @@ -257,6 +260,8 @@ class TestNotification(unittest.TestCase): contact.status = 'Replied' contact.save() + # adding sleep so that email queue is fetched once its created + time.sleep(10) email_queue = frappe.get_doc('Email Queue', {'reference_doctype': 'Contact', 'reference_name': contact.name})