-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: test mail attachments mimetypes
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
from flask_webtest import TestApp | ||
|
||
from canaille import create_app | ||
from canaille.app.mails import type_from_filename | ||
|
||
|
||
@pytest.fixture | ||
|
@@ -224,3 +225,8 @@ def test_default_from_flask_server_name(configuration, user, smtpd, backend): | |
res = res.form.submit(status=200) | ||
assert smtpd.messages[0]["X-MailFrom"] == "[email protected]" | ||
assert smtpd.messages[0]["From"] == '"Canaille" <[email protected]>' | ||
|
||
|
||
def test_type_from_filename(): | ||
assert type_from_filename("index.html") == ("text", "html") | ||
assert type_from_filename("unknown") == ("application", "octet-stream") |