-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert update notes in plaintext in email and __str__
Signed-off-by: Mattia Verga <[email protected]>
- Loading branch information
1 parent
18e3f0a
commit b061a7c
Showing
7 changed files
with
136 additions
and
42 deletions.
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
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
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 |
---|---|---|
|
@@ -143,6 +143,25 @@ def test_testing_update(self): | |
# The advisory flag should be included in the dnf instructions. | ||
assert 'dnf --enablerepo=updates-testing upgrade --advisory {}'.format(u.alias) in t | ||
|
||
def test_no_markdown(self): | ||
"""Update notes should be sent in plaintext.""" | ||
u = models.Update.query.first() | ||
u.notes = """Some **fancy** update description: | ||
- first element | ||
- second element | ||
Let's also have some code: | ||
```<[email protected]>``` | ||
""" | ||
|
||
t = mail.get_template(u) | ||
|
||
# Assemble the template for easier asserting. | ||
t = '\n'.join([line for line in t[0]]) | ||
assert 'Some fancy update description:' in t | ||
assert '```<[email protected]>```' not in t | ||
|
||
def test_read_template(self): | ||
"""Ensure that email template is read correctly.""" | ||
tpl_name = "maillist_template" | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Update notes are now converted to plaintext when printed in email or messages |