forked from Alir3z4/django-markwhat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.py
37 lines (33 loc) · 909 Bytes
/
run_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
"""
Running tests for django without using django-admin.py
Or using manage.py.
Bassically runnig just by executing this file.
Thanks to:
- http://stackoverflow.com/q/3841725/636136
- http://stackoverflow.com/a/3851333/636136
- http://stackoverflow.com/a/12260597/636136
"""
import os
import sys
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django_markwhat'
)
)
from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=2)
failures = test_runner.run_tests(['django_markwhat', ])
if failures:
sys.exit(failures)