-
Notifications
You must be signed in to change notification settings - Fork 0
#199 Markdown specification (part 2 of 2) #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
notifications_utils/template2.py
Outdated
Substitute personalization values into markdown, and return the markdown as HTML or plain text. | ||
""" | ||
|
||
# TODO - Perform substitutions in the markdown. Raise ValueError for missing fields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a ticket number on this TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
notifications_utils/template2.py
Outdated
if html_content is None and plain_text_content is None: | ||
raise ValueError('You must supply one of these parameters.') | ||
|
||
# TODO - Perform substitutions in the subject. Raise ValueError for missing fields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More TODOs - Do we need a ticket number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may be more, but I need to switch over to testing another ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, would still appreciate an answer to the question though regarding action links.
Questions were answered, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved - Reviewed recent commits
Description
These changes add more files to the tests/test_files/ subfolders to codify the expected behavior when rendering markdown as HTML or plain text, and they implement unit tests for all the test_files/ files. The new test files focus on personalization substitutions into links and block quotes, including the substitution of lists into the latter.
Substitutions into URLs of text containing spaces should be URL-safe encoded. The goal isn't that the link is valid (that's on the user); it's that the visual presentation is correct.
The unit tests include a simple happy path test and a test for missing personalization fields, both using markdown for a paragraph. I did not exhaustively test placeholders in all the various markdown permutations we might encounter because I don't think that would add value. When the tests I actually created for the hard cases pass, I am confident the functionality will work for the more straight-forward cases.
You might note that the 3 test classes I created are repetitive. Each class tests one input markdown file. With additional parametrization, I could roll all of these classes into a single test, but I rejected that implementation in favor of only loading the input files once, via a class-scoped fixture.
issue #199
How Has This Been Tested?
I ran the unit tests. The tests I added with this PR all run and fail with NotImplementedError, as is appropriate now. Subsequently, I skipped all these new tests. There are no changes required in notification-api. The next steps are #213, which builds out the implement needed to make these tests pass, and #215, which will integrate the new implementation with notification-api.
Checklist