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

Review Request #9625 - Created Feb. 12, 2018 and submitted

Christian Hammond
Djblets
master
658fd02...
djblets

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.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

David Trowbridge
  1. Ship It!
  2. 
      
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.0.x (fd064d6)
Loading...