This repository has been archived by the owner on Mar 12, 2021. It is now read-only.
forked from rajits/django-lessons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
111 lines (101 loc) · 3.49 KB
/
conftest.py
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
from django.conf import settings
import environ
import os
PROJECT_ROOT = environ.Path(__file__) - 2
env = environ.Env()
if os.path.exists(PROJECT_ROOT('.env')):
env.read_env(PROJECT_ROOT('.env'))
def pytest_configure():
settings_kwargs = {
'DEBUG': True,
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'dev.db',
}
},
'INSTALLED_APPS': [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sites',
'acknowledge',
'audience',
'biography',
'categories',
'categories.editor',
'cms',
'concepts',
'contentrelations',
'core_content',
'core_media',
'credits',
'curricula',
'edumetadata',
'expeditions',
'licensing',
'menus',
'navigation',
'ngsprojects',
'quotations',
'reference',
'resource_carousel',
'sf_models',
'taxonomy',
'teachingatlas',
'treebeard',
'viddler',
'viewmaster',
],
'LANGUAGE_CODE': 'en-us',
'LESSON_SETTINGS': {
'RELATION_MODELS': (
'reference.genericarticle',
'promotions.tease',
'promotions.promotion',
'curricula.activity', # for use as model student work, picture of practice
'acknowledge.organization',
'core_media.ngphoto',
'interactive_learning.interactive',
),
},
'MEDIA_URL': '/uploads/',
'PROJECT_ROOT': PROJECT_ROOT,
'ROOT_URLCONF': 'curricula.urls',
'SITE_ID': 1,
'STATIC_URL': '/static/',
'TEMPLATES': [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.template.context_processors.request",
"django.contrib.messages.context_processors.messages",
],
},
}, ],
'USE_TZ': True,
'VIDDLER_SETTINGS': {
'API_KEY': '15z0p5aul5vbiheho0js',
'USERNAME': 'apiuser',
'PASSWORD': 'casebook-ave-roll',
},
}
if 'TEST_DATABASE_SERVER' in os.environ:
TEST_DATABASE_URL = env('TEST_DATABASE_SERVER').rstrip('/') + "/test_curricula"
DATABASES = {
'default': env.db_url_config(TEST_DATABASE_URL)
}
DATABASES['default']['TEST'] = env.db_url_config(TEST_DATABASE_URL)
else:
DATABASES = {
'default': env.db('TEST_DATABASE_URL', default="postgresql://postgres:@localhost:5432/test_curricula")
}
DATABASES['default']['TEST'] = env.db('TEST_DATABASE_URL', default="postgresql://postgres:@localhost:5432/test_curricula")
settings_kwargs['DATABASES'] = DATABASES
settings.configure(**settings_kwargs)