Loading tests/logging_tests/tests.py +2 −2 Original line number Diff line number Diff line Loading @@ -91,8 +91,8 @@ class WarningLoggerTests(TestCase): """ def setUp(self): # If tests are invoke with "-Wall" (or any -W flag actually) then # warning logging gets disabled (see django/conf/__init__.py). However, # these tests expect warnings to be logged, so manually force warnings # warning logging gets disabled (see configure_logging in django/utils/log.py). # However, these tests expect warnings to be logged, so manually force warnings # to the logs. Use getattr() here because the logging capture state is # undocumented and (I assume) brittle. self._old_capture_state = bool(getattr(logging, '_warnings_showwarning', False)) Loading tests/runtests.py +6 −3 Original line number Diff line number Diff line Loading @@ -125,9 +125,12 @@ def setup(verbosity, test_labels): handler = logging.StreamHandler() logger.addHandler(handler) warnings.filterwarnings( 'ignore', 'django.contrib.comments is deprecated and will be removed before Django 1.8.', DeprecationWarning ) # Load all the ALWAYS_INSTALLED_APPS. with warnings.catch_warnings(): warnings.filterwarnings('ignore', 'django.contrib.comments is deprecated and will be removed before Django 1.8.', DeprecationWarning) django.setup() # Load all the test model apps. Loading Loading
tests/logging_tests/tests.py +2 −2 Original line number Diff line number Diff line Loading @@ -91,8 +91,8 @@ class WarningLoggerTests(TestCase): """ def setUp(self): # If tests are invoke with "-Wall" (or any -W flag actually) then # warning logging gets disabled (see django/conf/__init__.py). However, # these tests expect warnings to be logged, so manually force warnings # warning logging gets disabled (see configure_logging in django/utils/log.py). # However, these tests expect warnings to be logged, so manually force warnings # to the logs. Use getattr() here because the logging capture state is # undocumented and (I assume) brittle. self._old_capture_state = bool(getattr(logging, '_warnings_showwarning', False)) Loading
tests/runtests.py +6 −3 Original line number Diff line number Diff line Loading @@ -125,9 +125,12 @@ def setup(verbosity, test_labels): handler = logging.StreamHandler() logger.addHandler(handler) warnings.filterwarnings( 'ignore', 'django.contrib.comments is deprecated and will be removed before Django 1.8.', DeprecationWarning ) # Load all the ALWAYS_INSTALLED_APPS. with warnings.catch_warnings(): warnings.filterwarnings('ignore', 'django.contrib.comments is deprecated and will be removed before Django 1.8.', DeprecationWarning) django.setup() # Load all the test model apps. Loading