forked from simas/django-webtopay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
executable file
·39 lines (33 loc) · 1008 Bytes
/
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
#!/usr/bin/env python
import sys
from os.path import dirname, abspath
import django
from django.conf import settings
if not settings.configured:
settings.configure(
ROOT_URLCONF='webtopay.urls.makro',
INSTALLED_APPS=['webtopay'],
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3'
}
},
WEBTOPAY_PASSWORD='1c4196d0ff7fe4e94bdca98fb251bc25'
)
if django.VERSION >= (1, 8):
from django.test.runner import DiscoverRunner as DjangoTestRunner
django.setup()
else:
from django.test.simple import DjangoTestSuiteRunner as DjangoTestRunner
def runtests(*args):
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
testrunner = DjangoTestRunner()
if not args:
args = None
failures = testrunner.run_tests(args)
sys.exit(failures)
if __name__ == '__main__':
import logging
logging.basicConfig(level=logging.DEBUG)
runtests(*sys.argv[1:])