mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #21714 -- Moved logging configuration to global setup()
Thanks Aymeric Augustin for the report and the review.
This commit is contained in:
parent
1d23d766ab
commit
b8e3373f45
5 changed files with 36 additions and 41 deletions
|
@ -3,7 +3,6 @@ from __future__ import unicode_literals
|
|||
import logging
|
||||
import warnings
|
||||
|
||||
from django.conf import LazySettings
|
||||
from django.core import mail
|
||||
from django.test import TestCase, RequestFactory, override_settings
|
||||
from django.test.utils import patch_logger
|
||||
|
@ -342,15 +341,14 @@ def dictConfig(config):
|
|||
dictConfig.called = False
|
||||
|
||||
|
||||
class SettingsConfigureLogging(TestCase):
|
||||
class SetupConfigureLogging(TestCase):
|
||||
"""
|
||||
Test that calling settings.configure() initializes the logging
|
||||
configuration.
|
||||
Test that calling django.setup() initializes the logging configuration.
|
||||
"""
|
||||
@override_settings(LOGGING_CONFIG='logging_tests.tests.dictConfig')
|
||||
def test_configure_initializes_logging(self):
|
||||
settings = LazySettings()
|
||||
settings.configure(
|
||||
LOGGING_CONFIG='logging_tests.tests.dictConfig')
|
||||
from django import setup
|
||||
setup()
|
||||
self.assertTrue(dictConfig.called)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue