This repository has been archived by the owner on Feb 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
runtests.py
66 lines (55 loc) · 1.9 KB
/
runtests.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
#!/usr/bin/env python
import sys
import os
import warnings
from django.conf import settings
from django.core.management import execute_from_command_line
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=[
'cache_extension',
'tests',
],
CACHES={
"default": {
'NAME': '17bdc',
'BACKEND': 'cache_extension.backends.redis.ExtensionRedisBackend',
'LOCATION': 'redis://localhost:6379/0',
'TIMEOUT': '172800',
"KEY_PREFIX": "cache_extension",
'OPTIONS': {
"DB": 0,
'PARSER_CLASS': 'redis.connection.HiredisParser',
'PICKLE_VERSION': 2,
}
},
"redis": {
'NAME': '17bdc',
'BACKEND': 'cache_extension.backends.redis.ExtensionRedisBackend',
'LOCATION': 'redis://localhost:6379/0',
'TIMEOUT': '172800',
"KEY_PREFIX": "cache_extension",
'OPTIONS': {
"DB": 0,
"CLIENT_CLASS": "cache_extension.backends.redis.ExtensionClient",
'PARSER_CLASS': 'redis.connection.HiredisParser',
'PICKLE_VERSION': 2,
}
}
},
MIDDLEWARE_CLASSES=[],
)
warnings.simplefilter('default', DeprecationWarning)
warnings.simplefilter('default', PendingDeprecationWarning)
def runtests():
argv = sys.argv[:1] + ['test'] + sys.argv[1:]
execute_from_command_line(argv)
if __name__ == '__main__':
runtests()