Clean up the extension unit tests and prevent state leakage.

Review Request #8706 — Created Feb. 2, 2017 and submitted

Information

Djblets
release-0.10.x
0151746...

Reviewers

The extension unit test suite is pretty old at this point and a bit hard
to work with, due to the hacks that were in place to register
extensions. Since these were pretty ugly, we often reused the same
objects and classes across many tests, and then just bolted things onto
the instances. This may have led to some state leaks, and overall wasn't
nice to work with for new tests.

This change updates the test suites to construct their own extensions
within the test bodies and to utilize a new mixin class for setting up
the extension and extension manager. This means we have a fresh class
and instance for each test, and makes it easier to create more
specialized versions of the classes.

This is a precursor to a new set of unit tests coming in for extensions.

Unit tests pass.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/templatetags/tests.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/templatetags/tests.py
        djblets/extensions/tests.py
    
    
  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/templatetags/tests.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/templatetags/tests.py
        djblets/extensions/tests.py
    
    
  2. 
      
brennie
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (787f1b1)