• 
      

    Fix unit tests regressions involving SiteConfiguration and HTML output.

    Review Request #8328 — Created Aug. 15, 2016 and discarded — Latest diff uploaded

    Information

    Djblets

    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.
    
    Testing Done:
    Unit tests pass against Django 1.6 and 1.8.
    
    Reviewed at https://reviews.reviewboard.org/r/8300/
    File dev-requirements.txt need changes on line 9