test(email): Add test for accents in subject header
This commit is contained in:
parent
fbbdef1e9c
commit
ec20739fee
1 changed files with 14 additions and 0 deletions
|
|
@ -606,6 +606,20 @@ class TestInboundMail(FrappeTestCase):
|
|||
reference_doc = inbound_mail.reference_document()
|
||||
self.assertEqual(todo.name, reference_doc.name)
|
||||
|
||||
def test_reference_document_by_subject_match_with_accents(self):
|
||||
subject = "Nouvelle tâche à faire 😃"
|
||||
todo = self.new_todo(sender="test_sender@example.com", description=subject)
|
||||
|
||||
mail_content = (
|
||||
self.get_test_mail(fname="incoming-subject-placeholder.raw")
|
||||
.replace("{{ subject }}", f"RE: {subject}")
|
||||
.encode("utf-8")
|
||||
) # note: encode to bytes because that's what triggered the error
|
||||
email_account = frappe.get_doc("Email Account", "_Test Email Account 1")
|
||||
inbound_mail = InboundMail(mail_content, email_account, 12345, 1)
|
||||
reference_doc = inbound_mail.reference_document()
|
||||
self.assertEqual(todo.name, reference_doc.name)
|
||||
|
||||
def test_create_communication_from_mail(self):
|
||||
# Create email queue record
|
||||
mail_content = self.get_test_mail(fname="incoming-2.raw")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue