Fix unit tests regressions involving SiteConfiguration and HTML output.
Review Request #8300 — Created July 20, 2016 and submitted — Latest diff uploaded
The Features change broke all unit tests that deal with
SiteConfiguration
. This happened becausedjblets.features
, which
is put intoINSTALLED_APPS
, would importdjblets.features.checkers
,
which importedSiteConfiguration
.It's not valid for a module in
INSTALLED_APPS
to directly or indirectly
import a model. While this didn't actually break things in Django 1.6,
it does in 1.7 and higher, due to more strict behavior for model
loading. This import ended up preventingSiteConfiguration
from being
properly synchronized to the database.To fix this, the SiteConfiguration import has been moved into the
function that needs it.There were also two other HTML-related failures.
1) There was a check in the conditions tests that broke due to the
addition of newlines in generated HTML for one of the widgets we use.
We now useassertHTMLEqual()
to perform a more suitable check.2) We allowed use of an older Pygments releases, but tested against
newer HTML. We're now requiring a more modern version in
dev-requirements.txt.
Unit tests pass against Django 1.6 and 1.8.