mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Improved coverage
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user