summaryrefslogtreecommitdiff
path: root/tests/regressiontests/logging_tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-11-10 12:05:58 +0100
committerClaude Paroz <claude@2xlibre.net>2012-11-10 12:10:43 +0100
commite6bc0c5babe97af86679ef7fe4f5975eb86f532f (patch)
tree33ee07b4c1bd6feb98944d56d50cf58e84ceb779 /tests/regressiontests/logging_tests
parent6554137eebe4bd10bdf3f1be21f63f0a9cffd7ff (diff)
[1.5.x] Fixed #14264 -- Ensured settings.configure configures logging
Thanks Matt McDonald for the patch. Backport of 34162698c from master.
Diffstat (limited to 'tests/regressiontests/logging_tests')
-rw-r--r--tests/regressiontests/logging_tests/tests.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/regressiontests/logging_tests/tests.py b/tests/regressiontests/logging_tests/tests.py
index e40800efde..96f81981c6 100644
--- a/tests/regressiontests/logging_tests/tests.py
+++ b/tests/regressiontests/logging_tests/tests.py
@@ -4,7 +4,7 @@ import copy
import logging
import warnings
-from django.conf import compat_patch_logging_config
+from django.conf import compat_patch_logging_config, LazySettings
from django.core import mail
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
@@ -302,3 +302,20 @@ class SettingsConfigTest(AdminScriptTestCase):
out, err = self.run_manage(['validate'])
self.assertNoOutput(err)
self.assertOutput(out, "0 errors found")
+
+
+def dictConfig(config):
+ dictConfig.called = True
+dictConfig.called = False
+
+
+class SettingsConfigureLogging(TestCase):
+ """
+ Test that calling settings.configure() initializes the logging
+ configuration.
+ """
+ def test_configure_initializes_logging(self):
+ settings = LazySettings()
+ settings.configure(
+ LOGGING_CONFIG='regressiontests.logging_tests.tests.dictConfig')
+ self.assertTrue(dictConfig.called)