Moved warnings settings from manage.py and test_runner.py to one single place, settings.py. Decreased the verbosity level when invoking 'loaddata' from the test runner.

- Legacy-Id: 12535
This commit is contained in:
Henrik Levkowetz 2016-12-15 13:25:20 +00:00
parent fec5772f9a
commit 65481b5df7
3 changed files with 7 additions and 7 deletions

View file

@ -1,8 +1,5 @@
#!/usr/bin/env python
import warnings
warnings.filterwarnings("ignore",category=DeprecationWarning)
import os
import sys

View file

@ -7,6 +7,12 @@
import os
import sys
import datetime
import warnings
warnings.simplefilter("always", DeprecationWarning)
warnings.filterwarnings("ignore", message="Report.file_reporters will no longer be available in Coverage.py 4.2", module="coverage.report")
warnings.filterwarnings("ignore", message="initial_data fixtures are deprecated. Use data migrations instead.", module="django.core.management.commands.loaddata")
warnings.filterwarnings("ignore", message="The popen2 module is deprecated. Use the subprocess module.", module="ietf.utils.pipe")
try:
import syslog

View file

@ -41,7 +41,6 @@ import json
import pytz
import importlib
import socket
import warnings
import datetime
import codecs
import gzip
@ -87,7 +86,7 @@ def safe_create_1(self, verbosity, *args, **kwargs):
if settings.GLOBAL_TEST_FIXTURES:
print " Loading global test fixtures: %s" % ", ".join(settings.GLOBAL_TEST_FIXTURES)
loadable = [f for f in settings.GLOBAL_TEST_FIXTURES if "." not in f]
call_command('loaddata', *loadable, verbosity=verbosity, commit=False, database="default")
call_command('loaddata', *loadable, verbosity=int(verbosity)-1, commit=False, database="default")
for f in settings.GLOBAL_TEST_FIXTURES:
if f not in loadable:
@ -96,8 +95,6 @@ def safe_create_1(self, verbosity, *args, **kwargs):
module = importlib.import_module(".".join(components[:-1]))
fn = getattr(module, components[-1])
fn()
if verbosity < 2:
warnings.simplefilter("ignore", DeprecationWarning)
return test_database_name