Improve unit tests for datagrids and fix some issues that were caught.

Review Request #9625 — Created Feb. 12, 2018 and submitted — Latest diff uploaded

Information

Djblets
master
658fd02...

Reviewers

The datagrid unit tests were pretty old, and a bit scattered, with poor
naming and some tests that didn't actually properly test the
functionality. For instance, the datagrid rendering didn't check the
results, allowing errors to appear valid (since it's guaranteed that
exceptions won't be raised), and some of the sandboxing tests were
testing errors that the sandboxing code introduced.

This cleans up much of the testing, and the sandboxing bugs while there.
The test names have been changed to use the proper naming and casing
schemes, with proper docstrings. Some setup code has been removed or
made more efficient. Rendered HTML is more closely inspected.

The sandboxing tests have been folded up into other test suites, with
the code being more self-contained and ensuring the right things are
tested and right messages are logged.

A couple of values returned when sandboxing a custom column have been
fixed up as well. This prevents columns from rendering <td>None</td>
when failing to call render_data() and prevents order_by() error
messages when attempting to filter out a non-sortable field.

A bad ending </a> tag in the HTML for columns was also fixed.

Unit tests pass.