-
Notifications
You must be signed in to change notification settings - Fork 9
/
run_tests.py
56 lines (49 loc) · 1.41 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
48
49
50
51
52
53
54
55
56
# ==============================================================================
# IMPORTS
# ==============================================================================
# Python
from datetime import datetime
import pytz
import sys
# Django
from django.conf import settings
from django.core.management import execute_from_command_line
from django.utils import timezone
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.auth',
'timezone_utils',
'tests',
]
if not settings.configured:
test_runners_args = {}
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
},
INSTALLED_APPS=tuple(INSTALLED_APPS),
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
),
ROOT_URLCONF=None,
USE_TZ=True,
TIME_ZONE='UTC',
SECRET_KEY='secret',
LANGUAGE_CODE = 'en-us',
USE_I18N=True,
USE_L10N=True,
SITE_ID=1,
TEST_DATETIME=timezone.make_aware(
datetime(2014, 1, 1), pytz.timezone('UTC')
),
# SILENCED_SYSTEM_CHECKS=['1_7.W001'],
)
def runtests():
argv = sys.argv[:1] + ['test'] + sys.argv[1:]
execute_from_command_line(argv)
if __name__ == '__main__':
runtests()