Improved coverage

This commit is contained in:
Antoine Nguyen
2026-02-02 17:21:46 +01:00
parent 73bdd44774
commit bad207b489
2 changed files with 7 additions and 5 deletions
+6 -5
View File
@@ -96,12 +96,13 @@ def schedule_email(
mattachment = models.MessageAttachment(
message=sched_msg,
)
if "content-type" in attachment:
mattachment.content_type = attachment["content-type"]
elif "Content-Type" in attachment:
mattachment.content_type = attachment["Content-Type"]
else:
for header in ["content-type", "Content-Type"]:
if header in attachment:
mattachment.content_type = attachment[header]
break
if not mattachment.content_type:
continue
mattachment.file.name = attachment["tmpname"]
if "fname" in attachment:
mattachment.filename = attachment["fname"]
+1
View File
@@ -419,6 +419,7 @@ class ComposeSessionViewSetTestCase(WebmailTestCase):
{
"sender": self.user.email,
"to": ["test@example.test"],
"cc": ["cc@example.test"],
"subject": "test",
"body": "Test",
"scheduled_datetime": scheduled_datetime.isoformat(),