Since you are in Django, you could add these lines to your settings.py:
if len(sys.argv) > 1 and sys.argv == 'test':
That way you don't have to add that line in every setUp() on your tests.
You could also do a couple of handy changes for your test needs this way.
There is another "nicer" or "cleaner" way to add specifics to your tests and that is making your own test runner.
Just create a class like this:
from django.test.simple import DjangoTestSuiteRunner
from django.conf import settings
def run_tests(self, test_labels, extra_tests=None, **kwargs):
# Don't show logging messages while testing
return super(MyOwnTestRunner, self).run_tests(test_labels, extra_tests, **kwargs)
And now add to your settings.py file:
TEST_RUNNER = "PATH.TO.PYFILE.MyOwnTestRunner"
#(for example, 'utils.mytest_runner.MyOwnTestRunner'
Hope this is helpfull!