Browse Source

feat: add test

version-14
kamaljohnson 3 years ago
parent
commit
18820bf44e
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      frappe/email/doctype/email_account/test_email_account.py

+ 10
- 0
frappe/email/doctype/email_account/test_email_account.py View File

@@ -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):


Loading…
Cancel
Save