Skip to content

Commit 592de08

Browse files
committed
Remove django-debug-toolbar from test config to fix local test failure
Disable `debug_toolbar` from `INSTALLED_APPS` and its middleware in `test.py` settings to ensure tests pass locally regardless of developer setup.
1 parent 6c9e2bc commit 592de08

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

backend/pycon/settings/test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
from .base import env
21
from .base import * # noqa
2+
from .base import INSTALLED_APPS, MIDDLEWARE, env
33

44
IS_RUNNING_TESTS = True
55

6+
# Disable Django Debug Toolbar in tests
7+
ENABLE_DJANGO_DEBUG_TOOLBAR = False
8+
if "debug_toolbar" in INSTALLED_APPS:
9+
INSTALLED_APPS.remove("debug_toolbar")
10+
if "debug_toolbar.middleware.DebugToolbarMiddleware" in MIDDLEWARE:
11+
MIDDLEWARE.remove("debug_toolbar.middleware.DebugToolbarMiddleware")
12+
613
SECRET_KEY = "this-key-should-only-be-used-for-tests"
714
HASHID_DEFAULT_SECRET_SALT = "only-for-tests"
815

0 commit comments

Comments
 (0)