-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
executable file
·63 lines (51 loc) · 1.49 KB
/
tests.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
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
from __future__ import absolute_import
from django.conf import settings
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
settings.configure(
ROOT_URLCONF='django_comments_threaded.tests',
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'mptt',
'rest_framework',
'django_comments_threaded',
'django_comments_threaded.api',
),
MIGRATION_MODULES={
'django_comments_threaded': ('django_comments_threaded.'
'tests.migrations')
},
MIDDLEWARE_CLASSES=(
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
),
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':MEMORY:'
}
})
def main():
from django.test.utils import get_runner
import django
if hasattr(django, 'setup'):
django.setup()
test_runner = get_runner(settings)(
verbosity=2,
interactive=True,
failfast=True
)
failed = test_runner.run_tests([
'django_comments_threaded.tests',
'django_comments_threaded.api.tests',
])
sys.exit(failed)
if __name__ == '__main__':
main()