Fix rendering file attachment thumbnails in change descriptions.

Review Request #10912 — Created Feb. 24, 2020 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

The move to Django 1.11 broke rendering of file attachment thumbnails
in change descriptions, due to the usage of a Context class when
calling Template.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.

Commits

Files

    Loading...