This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.py
executable file
·64 lines (57 loc) · 1.67 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
57
58
59
60
61
62
63
64
#!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def root(*x):
return os.path.join(BASE_DIR, *x)
if not settings.configured:
settings.configure(
DEBUG=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test_db",
}
},
INSTALLED_APPS=(
"django.contrib.contenttypes",
"django.contrib.staticfiles",
"dc_utils",
"test_project",
"dc_signup_form",
),
ROOT_URLCONF="test_project.urls",
TEMPLATES=[
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
"DIRS": [
root("test_project/templates"),
],
"OPTIONS": {
"debug": True,
"context_processors": [
"dc_utils.context_processors.dc_django_utils",
"dc_signup_form.context_processors.signup_form",
],
},
}
],
MIDDLEWARE=[
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
],
SECRET_KEY="testing_key",
)
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=1, interactive=True, failfast=False)
failures = test_runner.run_tests(
[
"dc_signup_form",
]
)
sys.exit(failures)