Merge branch 'main' into pypi_release

This commit is contained in:
Christopher Broderick 2023-03-27 18:17:40 +01:00 committed by GitHub
commit 1bc1764c3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -82,7 +82,7 @@ class AttachmentIntegrationTests(TestCase):
# Ensure attachment is available with correct content
att = models.FollowUpAttachment.objects.get(
followup__ticket=response.context['ticket'])
with open(os.path.join(MEDIA_DIR, att.file.name)) as file_on_disk:
with open(os.path.join(MEDIA_DIR, att.file.name), encoding="utf-8") as file_on_disk:
disk_content = smart_str(file_on_disk.read(), 'utf-8')
self.assertEqual(disk_content, 'โจ')

View File

@ -56,7 +56,7 @@ class GetEmailCommonTests(TestCase):
Tests that emails with blank bodies and attachments work.
https://github.com/django-helpdesk/django-helpdesk/issues/700
"""
with open(os.path.join(THIS_DIR, "test_files/blank-body-with-attachment.eml")) as fd:
with open(os.path.join(THIS_DIR, "test_files/blank-body-with-attachment.eml"), encoding="utf-8") as fd:
test_email = fd.read()
ticket = helpdesk.email.object_from_message(
test_email, self.queue_public, self.logger)
@ -73,7 +73,7 @@ class GetEmailCommonTests(TestCase):
"""
Tests that emails with quoted-printable bodies work.
"""
with open(os.path.join(THIS_DIR, "test_files/quoted_printable.eml")) as fd:
with open(os.path.join(THIS_DIR, "test_files/quoted_printable.eml"), encoding="utf-8") as fd:
test_email = fd.read()
ticket = helpdesk.email.object_from_message(
test_email, self.queue_public, self.logger)
@ -94,7 +94,7 @@ class GetEmailCommonTests(TestCase):
Tests that emails with 8bit transfer encoding and utf-8 charset
https://github.com/django-helpdesk/django-helpdesk/issues/732
"""
with open(os.path.join(THIS_DIR, "test_files/all-special-chars.eml")) as fd:
with open(os.path.join(THIS_DIR, "test_files/all-special-chars.eml"), encoding="utf-8") as fd:
test_email = fd.read()
ticket = helpdesk.email.object_from_message(
test_email, self.queue_public, self.logger)
@ -107,7 +107,7 @@ class GetEmailCommonTests(TestCase):
Tests that emails with utf-8 non-decodable sequences are parsed correctly
The message is fowarded as well
"""
with open(os.path.join(THIS_DIR, "test_files/utf-nondecodable.eml")) as fd:
with open(os.path.join(THIS_DIR, "test_files/utf-nondecodable.eml"), encoding="utf-8") as fd:
test_email = fd.read()
ticket = helpdesk.email.object_from_message(
test_email, self.queue_public, self.logger)
@ -126,7 +126,7 @@ class GetEmailCommonTests(TestCase):
"""
Forwarded message of that format must be still attached correctly
"""
with open(os.path.join(THIS_DIR, "test_files/forwarded-message.eml")) as fd:
with open(os.path.join(THIS_DIR, "test_files/forwarded-message.eml"), encoding="utf-8") as fd:
test_email = fd.read()
ticket = helpdesk.email.object_from_message(
test_email, self.queue_public, self.logger)
@ -708,7 +708,7 @@ class GetEmailParametricTemplate(object):
and PGP signatures appropriately."""
# example email text from #567 on GitHub
with open(os.path.join(THIS_DIR, "test_files/pgp.eml")) as fd:
with open(os.path.join(THIS_DIR, "test_files/pgp.eml"), encoding="utf-8") as fd:
test_email = fd.read()
test_mail_len = len(test_email)