aboutsummaryrefslogtreecommitdiffstats
path: root/runtests.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-27 12:48:44 +0100
committerAymeric Augustin2013-10-27 12:48:44 +0100
commit9cb9796791062c9d208c0f887dc65142d42c022a (patch)
tree40ba69bec7f39115ccfcc88c5b1cfa2baf2f86ea /runtests.py
parentc710140a15222af2cf31b7579c6a5fedf9a482d5 (diff)
downloaddjango-debug-toolbar-9cb9796791062c9d208c0f887dc65142d42c022a.tar.bz2
Centralize access to config and default values.
Diffstat (limited to 'runtests.py')
-rw-r--r--runtests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtests.py b/runtests.py
index 544222c..bed16aa 100644
--- a/runtests.py
+++ b/runtests.py
@@ -34,6 +34,20 @@ if not settings.configured and not os.environ.get('DJANGO_SETTINGS_MODULE'):
SITE_ID=1,
)
+
+# Refresh the debug toolbar's configuration when overriding settings.
+from debug_toolbar.utils.settings import CONFIG, CONFIG_DEFAULTS
+from django.dispatch import receiver
+from django.test.signals import setting_changed
+
+
+@receiver(setting_changed)
+def update_connections_time_zone(**kwargs):
+ if kwargs['setting'] == 'DEBUG_TOOLBAR_CONFIG':
+ CONFIG.update(CONFIG_DEFAULTS)
+ CONFIG.update(kwargs['value'] or {})
+
+
from django.test.simple import DjangoTestSuiteRunner