The iar-backend Project

The iarbackend project contains top-level configuration and URL routes for the entire web application.

Settings

The iarbackend project ships a number of settings files.

Generic settings

The default iarbackend.settings module contains settings which are common to most deployment environments.

Test-suite specific settings

The iarbackend.settings_testsuite module contains settings which are specific to the test suite environment. The default tox test environment uses this settings module when running the test suite.

iarbackend.settings.tox.STATIC_ROOT = '/home/travis/build/uisautomation/iar-backend/build/static'

Static files are collected into a directory determined by the tox configuration. See the tox.ini file.

iarbackend.settings.tox.TEST_RUNNER = 'iarbackend.tests.runner.BufferedDiscoverRunner'

The default test runner is changed to one which captures stdout and stderr when running tests.

Developer specific settings

Custom test suite runner

The test suite settings overrides the TEST_RUNNER setting to point to BufferedTextTestRunner. This runner captures output to stdout and stderr and only reports the output if a test fails. This helps make our tests a little less noisy.

class iarbackend.tests.runner.BufferedDiscoverRunner(pattern=None, top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_mode=False, debug_sql=False, parallel=0, tags=None, exclude_tags=None, **kwargs)

A sub-class of django.test.runner.DiscoverRunner which has exactly the same behaviour except that the test_runner attribute is set to BufferedTextTestRunner.

The upshot of this is that output to stdout and stderror is captured and only reported on test failure.

class iarbackend.tests.runner.BufferedTextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, buffer=True, resultclass=None, warnings=None, *, tb_locals=False, **kwargs)

A sub-class of unittest.TextTestRunner with identical behaviour except that the buffer keyword argument to the constructor defaults to True.