-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
72 lines (70 loc) · 2.17 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
67
68
69
70
71
72
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == "__main__":
settings.configure(
DEBUG=True,
USE_TZ=True,
REST_FRAMEWORK={
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.BrowsableAPIRenderer',
],
},
ROOT_URLCONF="dogproject" + '.urls',
INSTALLED_APPS=[
"debug_toolbar",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sites",
"dogapi",
"dogui",
],
MIDDLEWARE=[
'debug_toolbar.middleware.DebugToolbarMiddleware',
],
LOGGING={
'version': 1,
'handlers': {
# existing handlers
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler'
}
},
'root': {
'level': 'DEBUG',
'handlers': ['console'],
},
'loggers': {
'': {
'level': 'DEBUG',
'handlers': ['console'],
}
}
},
API_NETLOC="http://127.0.0.1:8000/api",
TEMPLATE_LOADERS=[
'django.template.loaders.app_directories.Loader',
],
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
)
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=2)
failures = test_runner.run_tests(["dogapi.tests"])