From 18820bf44e56cbfee380bcc2b037f46ea87ec487 Mon Sep 17 00:00:00 2001 From: kamaljohnson Date: Wed, 2 Feb 2022 09:08:03 +0530 Subject: [PATCH] feat: add test --- .../email/doctype/email_account/test_email_account.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frappe/email/doctype/email_account/test_email_account.py b/frappe/email/doctype/email_account/test_email_account.py index 6d26f9f070..d59de050c4 100644 --- a/frappe/email/doctype/email_account/test_email_account.py +++ b/frappe/email/doctype/email_account/test_email_account.py @@ -246,6 +246,16 @@ class TestEmailAccount(unittest.TestCase): with self.assertRaises(Exception): email_account.validate() + def test_append_to(self): + email_aacount = frappe.get_doc("Email Account", "_Test Email Account 1") + mail_content = self.get_test_mail(fname="incoming-2.raw") + + inbound_mail = InboundMail(mail_content, email_aacount, 12345, 1, 'ToDo') + communication = inbound_mail.process() + if inbound_mail.append_to == 'ToDo': + self.assertEqual(communication.reference_doctype, 'ToDo') + self.assertTrue(communication.reference_name) + class TestInboundMail(unittest.TestCase): @classmethod def setUpClass(cls):