Running tests with maintenance mode on
mick88 opened this issue · comments
Issue: I found that running tests while maintenance mode was on failed a lot of tests because all views responded with 503.
Expected behaviour: I would expect that global maintenance mode does not affect test environment and tests run in isolation.
Example use case: Running tests in production to check whether it is deployed correctly before opening the site to public use.
Suggestion: Perhaps make it configurable with a MAINTENANCE_MODE_IGNORE_TEST
which would disable maintenance mode behaviour while running tests?
@mick88 could you try this solution in middleware.py?
http://stackoverflow.com/questions/4088253/django-how-to-detect-test-environment/7651002#7651002
Added support to settings.MAINTENANCE_MODE_IGNORE_TEST
with 0.5.0
version.