-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathtest_settings.py
More file actions
116 lines (101 loc) · 3.84 KB
/
test_settings.py
File metadata and controls
116 lines (101 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"""
These settings are here to use during tests, because django requires them.
In a real-world use case, apps in this project are installed into other
Django applications, so these settings will not be used.
"""
from __future__ import absolute_import, unicode_literals
from os import environ
from os.path import abspath, dirname, join
def root(*args):
"""
Get the absolute path of the given path relative to the project root.
"""
return join(abspath(dirname(__file__)), *args)
AUTH_USER_MODEL = 'auth.User'
CELERY_ALWAYS_EAGER = True
COMPLETION_AGGREGATOR_ASYNC_AGGREGATION = False
COMPLETION_AGGREGATOR_BLOCK_TYPES = {'course', 'chapter', 'sequential', 'vertical'}
COMPLETION_AGGREGATOR_TRACKING_EVENT_TYPES = COMPLETION_AGGREGATOR_BLOCK_TYPES
COMPLETION_AGGREGATOR_AGGREGATION_LOCK = 'COMPLETION_AGGREGATOR_AGGREGATION_LOCK'
COMPLETION_AGGREGATOR_CLEANUP_LOCK = 'COMPLETION_AGGREGATOR_CLEANUP_LOCK'
COMPLETION_AGGREGATOR_AGGREGATION_LOCK_TIMEOUT_SECONDS = 1800
COMPLETION_AGGREGATOR_CLEANUP_LOCK_TIMEOUT_SECONDS = 900
COMPLETION_AGGREGATOR_AGGREGATE_UNRELEASED_BLOCKS = False
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.mysql',
'NAME': 'completion_aggregator_test',
'HOST': environ.get('EDXAGG_MYSQL_HOST', '127.0.0.1'),
'PORT': int(environ.get('EDXAGG_MYSQL_PORT', 3307)),
'USER': environ.get('EDXAGG_MYSQL_USER', 'root'),
'PASSWORD': environ.get('EDXAGG_MYSQL_PASSWORD', 'rootpw'),
'OPTIONS': {
'init_command': "SET sql_mode='ALLOW_INVALID_DATES'",
}
}
}
DEBUG = True
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.admin',
'completion',
'oauth2_provider',
'waffle',
'test_utils.test_app',
'eventtracking.django.apps.EventTrackingConfig',
'event_routing_backends',
'completion_aggregator',
)
LOCALE_PATHS = [root('completion_aggregator', 'conf', 'locale')]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
REST_FRAMEWORK = {
'PAGE_SIZE': 10,
}
ROOT_URLCONF = 'completion_aggregator.urls'
SECRET_KEY = 'insecure-secret-key'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth', # this is required for admin
'django.contrib.messages.context_processors.messages', # this is required for admin
'django.template.context_processors.request', # this is required for admin
],
},
},
]
USE_TZ = True
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
# Suppress noisy import errors from event_routing_backends when running outside LMS.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'loggers': {
'event_routing_backends.helpers': {
'level': 'CRITICAL',
},
},
}
# Enables event tracking in the tests, see https://github.com/openedx/event-tracking
EVENT_TRACKING_ENABLED = True
EVENT_TRACKING_BACKENDS = {}
# Provided so the generated xAPI events use a known LMS URL when testing.
LMS_ROOT_URL = "http://localhost:18000"
# Provided so the generated xAPI events use a known "event routing backends package string" when testing.
RUNNING_WITH_TEST_SETTINGS = True
# pylint: disable=unused-import,wrong-import-position
from test_utils.test_app import celery # isort:skip