forked from readthedocs/readthedocs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
56 lines (40 loc) · 1.42 KB
/
test.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
from __future__ import absolute_import
import os
from .dev import CommunityDevSettings
class CommunityTestSettings(CommunityDevSettings):
SLUMBER_USERNAME = 'test'
SLUMBER_PASSWORD = 'test'
SLUMBER_API_HOST = 'http://localhost:8000'
# A bunch of our tests check this value in a returned URL/Domain
PRODUCTION_DOMAIN = 'readthedocs.org'
DEBUG = False
TEMPLATE_DEBUG = False
ELASTICSEARCH_DSL_AUTOSYNC = False
ELASTICSEARCH_DSL_AUTO_REFRESH = True
CELERY_ALWAYS_EAGER = True
# Skip automatic detection of Docker limits for testing
DOCKER_LIMITS = {'memory': '200m', 'time': 600}
STRIPE_PUBLISHABLE = 'pk_test_'
STRIPE_SECRET = 'sk_test_'
@property
def ES_INDEXES(self): # noqa - avoid pep8 N802
es_indexes = super(CommunityTestSettings, self).ES_INDEXES
for index_conf in es_indexes.values():
index_conf['name'] = "test_{}".format(index_conf['name'])
return es_indexes
@property
def LOGGING(self): # noqa - avoid pep8 N802
logging = super(CommunityDevSettings, self).LOGGING
return logging
CommunityTestSettings.load_settings(__name__)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'PREFIX': 'docs',
}
}
if not os.environ.get('DJANGO_SETTINGS_SKIP_LOCAL', False):
try:
from .local_settings import * # noqa
except ImportError:
pass