Fix unit tests regressions involving SiteConfiguration and HTML output.

Review Request #8300 — Created July 20, 2016 and submitted

Information

Djblets
release-0.10.x
e57fc89...

Reviewers

The Features change broke all unit tests that deal with
SiteConfiguration. This happened because djblets.features, which
is put into INSTALLED_APPS, would import djblets.features.checkers,
which imported SiteConfiguration.

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 preventing SiteConfiguration 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 use assertHTMLEqual() 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.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/features/checkers.py
        djblets/forms/tests/test_conditions_widget.py
    
    Ignored Files:
        dev-requirements.txt
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/features/checkers.py
        djblets/forms/tests/test_conditions_widget.py
    
    Ignored Files:
        dev-requirements.txt
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (cc1263a)
Loading...