Speed up tests.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-08-23 00:17:53 -04:00
parent d6fd1b66c6
commit 48e7b7970c
4 changed files with 43 additions and 15 deletions
+33 -5
View File
@@ -10,15 +10,43 @@ INSTALLED_APPS = [
COMMON_PRODUCTION_ERROR_LOG_PATH = '/tmp/mayan-errors.log'
TEMPLATES[0]['OPTIONS']['loaders'] = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
# Remove whitenoise from middlewares. Causes out of memory errors during test
# suit
MIDDLEWARE_CLASSES = [
cls for cls in MIDDLEWARE_CLASSES if cls != 'whitenoise.middleware.WhiteNoiseMiddleware'
]
# User a simpler password hasher
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
STATICFILES_STORAGE = None
# Cache templates in memory
TEMPLATES[0]['OPTIONS']['loaders'] = (
(
'django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
),
)
CELERY_ALWAYS_EAGER = True
CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
BROKER_BACKEND = 'memory'
# Remove middlewares not used for tests
MIDDLEWARE_CLASSES = [
cls for cls in MIDDLEWARE_CLASSES if cls not in [
'common.middleware.error_logging.ErrorLoggingMiddleware',
'django.middleware.security.SecurityMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
'common.middleware.timezone.TimezoneMiddleware',
'common.middleware.ajax_redirect.AjaxRedirect',
]
]