-
Notifications
You must be signed in to change notification settings - Fork 6
/
runtests.py
34 lines (27 loc) · 1.15 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
# -*- coding: utf-8 -*-
import os, sys
from django.conf import settings
from django.core.management import call_command
DIRNAME = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIRNAME, 'database.db'),
}
}
settings.configure(DEBUG = True,
DATABASES=DATABASES,
USE_TZ=True,
AUTHY_KEY='12345678910111213141516171819201234567891011121314151617181920',
ROOT_URLCONF='authy.urls',
PASSWORD_HASHERS=('django.contrib.auth.hashers.MD5PasswordHasher',), # simple fast hasher but not secure
INSTALLED_APPS = ('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'authy',))
from django.test.simple import DjangoTestSuiteRunner
call_command('syncdb', interactive=False)
failures = DjangoTestSuiteRunner().run_tests(['authy',], verbosity=1)
if failures:
sys.exit(failures)