-
Notifications
You must be signed in to change notification settings - Fork 4
/
run_tests.py
47 lines (40 loc) · 1.11 KB
/
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
38
39
40
41
42
43
44
45
46
47
# !/usr/bin/env python
import sys
from os.path import dirname, abspath
import django
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='khipu.urls',
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'khipu',
),
LOGGER_KHIPU='logger_khipu',
USE_TZ=True,
KHIPU_RECEIVER_ID="148653",
KHIPU_SECRET_KEY="73ebf4fc9d41f9892ab00a12d5070cdf389767f6"
)
try:
# Django < 1.8
from django.test.simple import DjangoTestSuiteRunner
except ImportError:
# Django >= 1.8
from django.test.runner import DiscoverRunner as DjangoTestSuiteRunner
def runtests():
django.setup()
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
test_runner = DjangoTestSuiteRunner(verbosity=1)
failures = test_runner.run_tests(['khipu'], verbosity=1, interactive=True)
if failures:
sys.exit(failures)
if __name__ == '__main__':
runtests()