mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-11 12:17:37 +03:00
da42b3854d
This resolves the following error: ``` bash coverage run ./manage.py test --settings=config.settings.test Coverage.py warning: Disabling plugin 'django_coverage_plugin.DjangoTemplatePlugin' due to an exception: Traceback (most recent call last): File "/Users/audreyr/.virtualenvs/everycheese/lib/python3.5/site-packages/coverage/control.py", line 517, in _should_trace_internal file_tracer = plugin.file_tracer(canonical) File "/Users/audreyr/.virtualenvs/everycheese/lib/python3.5/site-packages/django_coverage_plugin/plugin.py", line 154, in file_tracer check_debug() File "/Users/audreyr/.virtualenvs/everycheese/lib/python3.5/site-packages/django_coverage_plugin/plugin.py", line 69, in check_debug "Template debugging must be enabled in settings." django_coverage_plugin.plugin.DjangoTemplatePluginException: Template debugging must be enabled in settings. ```
64 lines
2.0 KiB
Python
64 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
Test settings
|
|
|
|
- Used to run tests fast on the continuous integration server and locally
|
|
'''
|
|
|
|
from .common import * # noqa
|
|
|
|
|
|
# DEBUG
|
|
# ------------------------------------------------------------------------------
|
|
# Turn debug off so tests run faster
|
|
DEBUG = False
|
|
# But template debugging must be enabled for django_coverage_plugin
|
|
TEMPLATES[0]['OPTIONS']['debug'] = True
|
|
|
|
# SECRET CONFIGURATION
|
|
# ------------------------------------------------------------------------------
|
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
|
# Note: This key only used for development and testing.
|
|
SECRET_KEY = env('DJANGO_SECRET_KEY', default='CHANGEME!!!')
|
|
|
|
# Mail settings
|
|
# ------------------------------------------------------------------------------
|
|
EMAIL_HOST = 'localhost'
|
|
EMAIL_PORT = 1025
|
|
|
|
# In-memory email backend stores messages in django.core.mail.outbox
|
|
# for unit testing purposes
|
|
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
|
|
|
|
# CACHING
|
|
# ------------------------------------------------------------------------------
|
|
# Speed advantages of in-memory caching without having to run Memcached
|
|
CACHES = {
|
|
'default': {
|
|
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
|
'LOCATION': ''
|
|
}
|
|
}
|
|
|
|
# TESTING
|
|
# ------------------------------------------------------------------------------
|
|
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
|
|
|
|
|
# PASSWORD HASHING
|
|
# ------------------------------------------------------------------------------
|
|
# Use fast password hasher so tests run faster
|
|
PASSWORD_HASHERS = (
|
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
|
)
|
|
|
|
# TEMPLATE LOADERS
|
|
# ------------------------------------------------------------------------------
|
|
# Keep templates in memory so tests run faster
|
|
TEMPLATES[0]['OPTIONS']['loaders'] = [
|
|
('django.template.loaders.cached.Loader', [
|
|
'django.template.loaders.filesystem.Loader',
|
|
'django.template.loaders.app_directories.Loader',
|
|
]),
|
|
]
|