Skip to content

Commit 8bc8d00

Browse files
committed
Added SessionMiddleware and AuthenticationMiddleware to test_settings
These are commonly needed when testing the app locally and without them we get the annoying `'WSGIRequest' object has no attribute 'user'` error
1 parent 68110ac commit 8bc8d00

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: template/VAR_PACKAGE_NAME/tests/test_settings.py

+2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
INSTALLED_APPS = EXTERNAL_APPS + INTERNAL_APPS
5858

5959
MIDDLEWARE_CLASSES = [
60+
'django.contrib.sessions.middleware.SessionMiddleware',
6061
'django.middleware.common.CommonMiddleware',
62+
'django.contrib.auth.middleware.AuthenticationMiddleware',
6163
'django.middleware.csrf.CsrfViewMiddleware',
6264
]
6365

0 commit comments

Comments
 (0)