-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_settings.py
More file actions
92 lines (74 loc) · 2.37 KB
/
test_settings.py
File metadata and controls
92 lines (74 loc) · 2.37 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
"""
Minimal Django settings for running tests on xblocks_contrib.
"""
from pathlib import Path
from django.http import HttpResponse
from django.urls import re_path
BASE_DIR = Path(__file__).resolve().parent
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"submissions",
"edxval",
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
def dummy_callback(_request, *_args, **_kwargs):
"""
Minimal placeholder view for test URL patterns.
Underscored arguments silence lint warnings for unused variables.
"""
return HttpResponse("OK")
ROOT_URLCONF = type(
"URLConf",
(),
{
"urlpatterns": [
re_path(
r"^courses/(?P<course_id>.+)/xqueue/(?P<userid>[^/]+)/(?P<mod_id>.+)/(?P<dispatch>[^/]+)$",
dummy_callback,
name="xqueue_callback",
),
]
},
)
LMS_ROOT_URL = "http://localhost:8000"
# Code jail REST service
ENABLE_CODEJAIL_REST_SERVICE = False
# Set the python package.module.function that is reponsible of
# calling the remote service in charge of jailed code execution
CODE_JAIL_REST_SERVICE_REMOTE_EXEC = "xblocks_contrib.problem.capa.safe_exec.remote_exec.send_safe_exec_request_v0"
# Set the codejail remote service host
CODE_JAIL_REST_SERVICE_HOST = "http://127.0.0.1:8550"
# Set the number of seconds LMS will wait to establish an internal
# connection to the codejail remote service.
CODE_JAIL_REST_SERVICE_CONNECT_TIMEOUT = 0.5 # time in seconds
# Set the number of seconds LMS/CMS will wait for a response from the
# codejail remote service endpoint.
CODE_JAIL_REST_SERVICE_READ_TIMEOUT = 3.5 # time in seconds
# CAPA External Code Evaluation #
# Used with XQueue
XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5 # seconds
XQUEUE_INTERFACE = {
"url": "http://localhost:18040",
"basic_auth": ["edx", "edx"],
"django_auth": {"username": "lms", "password": "password"},
}
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
BASE_DIR / "xblocks_contrib" / "problem" / "capa" / "templates",
],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.request",
],
},
},
]
TRANSCRIPT_LANG_CACHE_TIMEOUT = 60 * 60 * 24 # 24 hours