From 52a0a905a7b63d460a5f8a8aaf18034c61b1b0ed Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sat, 22 May 2021 20:44:48 +0530 Subject: [PATCH] test: Fix email tracker test case --- frappe/tests/test_email.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frappe/tests/test_email.py b/frappe/tests/test_email.py index 1f17764a18..8340db4852 100644 --- a/frappe/tests/test_email.py +++ b/frappe/tests/test_email.py @@ -15,7 +15,6 @@ class TestEmail(unittest.TestCase): frappe.db.sql("""delete from `tabEmail Queue Recipient`""") def test_email_queue(self, send_after=None): - frappe.conf.use_ssl = True frappe.sendmail(recipients=['test@example.com', 'test1@example.com'], sender="admin@example.com", reference_doctype='User', reference_name='Administrator', @@ -30,9 +29,6 @@ class TestEmail(unittest.TestCase): self.assertTrue('test1@example.com' in queue_recipients) self.assertEqual(len(queue_recipients), 2) self.assertTrue('' in email_queue[0]['message']) - # check for email tracker - self.assertTrue('frappe.core.doctype.communication.email.mark_email_as_seen' in email_queue[0]['message']) - frappe.conf.use_ssl = False def test_send_after(self): self.test_email_queue(send_after=1) @@ -75,6 +71,7 @@ class TestEmail(unittest.TestCase): self.assertTrue('CC: test1@example.com' in message) def test_cc_footer(self): + frappe.conf.use_ssl = True # test if sending with cc's makes it into header frappe.sendmail(recipients=['test@example.com'], cc=['test1@example.com'], @@ -92,7 +89,12 @@ class TestEmail(unittest.TestCase): self.assertTrue('This email was sent to test@example.com and copied to test1@example.com' in frappe.safe_decode( frappe.flags.sent_mail)) + # check for email tracker + self.assertTrue('mark_email_as_seen' in frappe.safe_decode(frappe.flags.sent_mail)) + frappe.conf.use_ssl = False + def test_expose(self): + from frappe.utils.verified_command import verify_request frappe.sendmail(recipients=['test@example.com'], cc=['test1@example.com'],