Speed up tests

~20% less using MD5 and force_login in kfet testcase.
~77% less by disabling the debug tollbar.
This commit is contained in:
Aurélien Delobelle 2018-01-15 05:26:33 +01:00
parent 44eee9be38
commit 6059ca067b
3 changed files with 18 additions and 15 deletions

View file

@ -4,13 +4,18 @@ The settings that are not listed here are imported from .common
"""
from .common import * # NOQA
from .common import INSTALLED_APPS, MIDDLEWARE
from .common import INSTALLED_APPS, MIDDLEWARE, TESTING
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEBUG = True
if TESTING:
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
]
# ---
# Apache static/media config
@ -36,12 +41,13 @@ def show_toolbar(request):
"""
return DEBUG
INSTALLED_APPS += ["debug_toolbar", "debug_panel"]
if not TESTING:
INSTALLED_APPS += ["debug_toolbar", "debug_panel"]
MIDDLEWARE = [
"debug_panel.middleware.DebugPanelMiddleware"
] + MIDDLEWARE
MIDDLEWARE = [
"debug_panel.middleware.DebugPanelMiddleware"
] + MIDDLEWARE
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
}
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
}