From 26d9e256ea0c3e3241a102d25865cd49d3dbf0d2 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 30 May 2024 19:13:32 +0100 Subject: [PATCH] Don't enable DDT during tests --- website/settings.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/website/settings.py b/website/settings.py index d74aa79..8489994 100644 --- a/website/settings.py +++ b/website/settings.py @@ -320,14 +320,15 @@ if DEBUG: INSTALLED_APPS.append("django_browser_reload") MIDDLEWARE.append("django_browser_reload.middleware.BrowserReloadMiddleware") - # Add django-debug-toolbar - INSTALLED_APPS.append("debug_toolbar") - MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware") - DEBUG_TOOLBAR_CONFIG = { - "SHOW_TOOLBAR_CALLBACK": "website.common.utils.show_toolbar_callback", - "RESULTS_CACHE_SIZE": 5, - "SHOW_COLLAPSED": True, - } + if not TEST: + # Add django-debug-toolbar + INSTALLED_APPS.append("debug_toolbar") + MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware") + DEBUG_TOOLBAR_CONFIG = { + "SHOW_TOOLBAR_CALLBACK": "website.common.utils.show_toolbar_callback", + "RESULTS_CACHE_SIZE": 5, + "SHOW_COLLAPSED": True, + } # Add Wagtail styleguide INSTALLED_APPS.append("wagtail.contrib.styleguide")