Fix rendering file attachment thumbnails in change descriptions.
Review Request #10912 — Created Feb. 24, 2020 and submitted
The move to Django 1.11 broke rendering of file attachment thumbnails
in change descriptions, due to the usage of aContext
class when
callingTemplate.render()
. In modern Django, we only want to pass a
dictionary.We also want to ensure we're returning safe strings, to prepare for a
future where we're being more strict with field-generated HTML.This updates rendering to use the modern conventions.
This is only the second field to get an actual unit test suite (a small
one at this point). As such, part of this change splits out the useful
bits of the other field's tests into a common class, making it easier to
add future tests.
Loaded a page with changed file attachments. Instead of blowing up,
it rendered the thumbnails with the correct information.Unit tests pass.
Summary | ID |
---|---|
b7ef122a3e94ae0813500702ed05d290acb092e0 |