forked from django-ses/django-ses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
38 lines (32 loc) · 1.03 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
35
36
37
38
"""
This code provides a mechanism for running django_ses' internal
test suite without having a full Django project. It sets up the
global configuration, then dispatches out to `call_command` to
kick off the test suite.
## The Code
"""
# Setup and configure the minimal settings necessary to
# run the test suite. Note that Django requires that the
# `DATABASES` value be present and configured in order to
# do anything.
import django
from django.conf import settings
from django.core.management import call_command
settings.configure(
INSTALLED_APPS=[
"django_ses",
],
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
},
MIDDLEWARE_CLASSES=('django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware'),
ROOT_URLCONF='tests.test_urls',
SECRET_KEY="not-secret",
)
django.setup()
# Start the test suite now that the settings are configured.
call_command("test", "tests", verbosity=3)