diff options
| author | Aymeric Augustin | 2013-11-09 19:38:47 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-10 10:39:42 +0100 |
| commit | b8d3c1c9043c782f15e9cea9c5d4f50ca5bae46a (patch) | |
| tree | ec36cbec18533b59cca7749e3d4ebac07294594b /tests/__init__.py | |
| parent | 53bf40f6374830bd6d106d92c00897c5b6e44e8a (diff) | |
| download | django-debug-toolbar-b8d3c1c9043c782f15e9cea9c5d4f50ca5bae46a.tar.bz2 | |
Invalidate cached list of panels during tests.
Diffstat (limited to 'tests/__init__.py')
| -rw-r--r-- | tests/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 3b83e4c..178fd1c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,8 @@ # Refresh the debug toolbar's configuration when overriding settings. from debug_toolbar.utils.settings import CONFIG, CONFIG_DEFAULTS +from debug_toolbar.toolbar.loader import load_panel_classes, panel_classes + from django.dispatch import receiver from django.test.signals import setting_changed @@ -10,3 +12,11 @@ def update_toolbar_config(**kwargs): if kwargs['setting'] == 'DEBUG_TOOLBAR_CONFIG': CONFIG.update(CONFIG_DEFAULTS) CONFIG.update(kwargs['value'] or {}) + + +@receiver(setting_changed) +def update_toolbar_panels(**kwargs): + if kwargs['setting'] == 'DEBUG_TOOLBAR_PANELS': + global panel_classes + panel_classes = [] + load_panel_classes() |
