Fix rendering file attachment thumbnails in change descriptions.

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

chipx86
Review Board
release-4.0.x
reviewboard

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.

Summary
Fix rendering file attachment thumbnails in change descriptions.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (51bc2a4)
Loading...