Clean up and document the unit test utility functions.
Review Request #9555 — Created Jan. 30, 2018 and submitted — Latest diff uploaded
The unit test code makes use of a handful of utility functions, which
handle things like replacing app labels and model names for a batch of
models, populating the database with models, executing SQL, generating
index names to test against for different versions of Django, and more.
Most of this code was pretty old and undocumented, and some of it turned
out to be unnecessary.This change makes some big cleanups to this code. A whole lot of
functions have been removed (either outright due to no longer being
used, or rolled up into the test case or other code that needed them).
Other functions had unused parameters or logic removed. The remaining
ones received some sizable documentation improvements, helping to make
the code more understandable and maintainable.In the process, this has been made a bit more Python 3-compatible,
switching to Unicode strings and thesix
module (though at the moment,
this has not been tested on Python 3).
Unit tests pass on all supported versions of Django.