From 9cb9796791062c9d208c0f887dc65142d42c022a Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 27 Oct 2013 12:48:44 +0100 Subject: Centralize access to config and default values. --- runtests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtests.py') 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 -- cgit v1.2.3