Skip to content

Load the content of panels dynamically #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 10, 2013
Prev Previous commit
Next Next commit
Invalidate cached list of panels during tests.
  • Loading branch information
aaugustin committed Nov 10, 2013
commit b8d3c1c9043c782f15e9cea9c5d4f50ca5bae46a
10 changes: 10 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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()