|
|
@@ -14,14 +14,16 @@ from frappe.email.doctype.email_account.email_account import notify_unreplied |
|
|
|
from frappe.email.email_body import get_message_id |
|
|
|
from frappe.email.receive import Email, InboundMail, SentEmailInInboxError |
|
|
|
from frappe.test_runner import make_test_records |
|
|
|
from frappe.tests.utils import FrappeTestCase |
|
|
|
|
|
|
|
make_test_records("User") |
|
|
|
make_test_records("Email Account") |
|
|
|
|
|
|
|
|
|
|
|
class TestEmailAccount(unittest.TestCase): |
|
|
|
class TestEmailAccount(FrappeTestCase): |
|
|
|
@classmethod |
|
|
|
def setUpClass(cls): |
|
|
|
super().setUpClass() |
|
|
|
email_account = frappe.get_doc("Email Account", "_Test Email Account 1") |
|
|
|
email_account.db_set("enable_incoming", 1) |
|
|
|
email_account.db_set("enable_auto_reply", 1) |
|
|
@@ -362,6 +364,7 @@ class TestEmailAccount(unittest.TestCase): |
|
|
|
self.assertTrue(communication.reference_name) |
|
|
|
self.assertTrue(frappe.db.exists(communication.reference_doctype, communication.reference_name)) |
|
|
|
|
|
|
|
@unittest.skip("poorly written and flaky") |
|
|
|
def test_append_to_with_imap_folders(self): |
|
|
|
mail_content_1 = self.get_test_mail(fname="incoming-1.raw") |
|
|
|
mail_content_2 = self.get_test_mail(fname="incoming-2.raw") |
|
|
@@ -434,9 +437,10 @@ class TestEmailAccount(unittest.TestCase): |
|
|
|
email_account.receive() |
|
|
|
|
|
|
|
|
|
|
|
class TestInboundMail(unittest.TestCase): |
|
|
|
class TestInboundMail(FrappeTestCase): |
|
|
|
@classmethod |
|
|
|
def setUpClass(cls): |
|
|
|
super().setUpClass() |
|
|
|
email_account = frappe.get_doc("Email Account", "_Test Email Account 1") |
|
|
|
email_account.db_set("enable_incoming", 1) |
|
|
|
|
|
|
|