2017-10-12 20:36:44 +03:00
|
|
|
"""
|
|
|
|
Test settings for {{cookiecutter.project_name}} project.
|
2016-06-23 21:41:44 +03:00
|
|
|
|
|
|
|
- Used to run tests fast on the continuous integration server and locally
|
2017-10-12 20:36:44 +03:00
|
|
|
"""
|
2016-06-23 21:41:44 +03:00
|
|
|
|
2017-01-17 06:38:52 +03:00
|
|
|
from .base import * # noqa
|
2016-06-23 21:41:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
# DEBUG
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Turn debug off so tests run faster
|
|
|
|
DEBUG = False
|
2016-09-16 21:49:13 +03:00
|
|
|
TEMPLATES[0]['OPTIONS']['debug'] = False
|
2016-06-23 21:41:44 +03:00
|
|
|
|
|
|
|
# SECRET CONFIGURATION
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
|
|
|
# Note: This key only used for development and testing.
|
2018-02-07 22:52:52 +03:00
|
|
|
SECRET_KEY = env('DJANGO_SECRET_KEY', default='!!!SET DJANGO_SECRET_KEY!!!')
|
2016-06-23 21:41:44 +03:00
|
|
|
|
|
|
|
# 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
|
2017-02-13 21:33:52 +03:00
|
|
|
PASSWORD_HASHERS = [
|
2016-06-23 21:41:44 +03:00
|
|
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
2017-02-13 21:33:52 +03:00
|
|
|
]
|
2016-06-23 21:41:44 +03:00
|
|
|
|
|
|
|
# TEMPLATE LOADERS
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Keep templates in memory so tests run faster
|
|
|
|
TEMPLATES[0]['OPTIONS']['loaders'] = [
|
2017-02-13 21:33:52 +03:00
|
|
|
['django.template.loaders.cached.Loader', [
|
2016-06-23 21:41:44 +03:00
|
|
|
'django.template.loaders.filesystem.Loader',
|
|
|
|
'django.template.loaders.app_directories.Loader',
|
2017-02-13 21:33:52 +03:00
|
|
|
], ],
|
2016-06-23 21:41:44 +03:00
|
|
|
]
|