django-notifications/notifications/tests/settings.py

80 lines
2.1 KiB
Python
Raw Normal View History

''' Django notification settings for tests '''
# -*- coding: utf-8 -*-
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
2020-04-08 21:40:02 +00:00
SECRET_KEY = 'secret_key' # noqa
DEBUG = True
TESTING = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.sqlite3',
2015-12-11 13:32:20 +00:00
}
}
2017-12-07 00:38:29 +00:00
# Django < 2.0
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
2019-04-18 09:58:42 +00:00
'django.contrib.messages.middleware.MessageMiddleware'
)
2017-12-07 00:38:29 +00:00
# Django >= 2.0
MIDDLEWARE = MIDDLEWARE_CLASSES
2017-12-07 00:38:29 +00:00
2020-04-08 21:40:02 +00:00
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
2019-04-18 09:58:42 +00:00
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sessions',
'notifications.tests',
'notifications',
2020-04-08 21:40:02 +00:00
]
ROOT_URLCONF = 'notifications.tests.urls'
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = os.path.join(BASE_DIR, "static-files")
2015-03-29 06:37:27 +00:00
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'OPTIONS': {
2020-04-08 21:40:02 +00:00
'loaders' : [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
LOGIN_REDIRECT_URL = 'test/'
LOGIN_URL = '/admin/login/'
APPEND_SLASH = True
2018-05-30 05:18:33 +00:00
2018-05-30 05:21:16 +00:00
DJANGO_NOTIFICATIONS_CONFIG = {
2018-05-30 05:18:33 +00:00
'USE_JSONFIELD': True,
}
2018-06-08 02:02:35 +00:00
USE_TZ = True
2020-04-08 21:40:02 +00:00
if os.environ.get('SAMPLE_APP', False):
INSTALLED_APPS.remove('notifications')
INSTALLED_APPS.append('notifications.tests.sample_notifications')
NOTIFICATIONS_NOTIFICATION_MODEL = 'sample_notifications.Notification'
TEMPLATES[0]['DIRS'] += [os.path.join(BASE_DIR, '../templates')]