-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconftest.py
46 lines (38 loc) · 1019 Bytes
/
conftest.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
from pathlib import Path
from django import setup as django_setup
from django.conf import settings
def pytest_configure():
databases = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
templates = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": ["tests/templates"],
"OPTIONS": {
"context_processors": [
"django.template.context_processors.request",
],
},
}
]
installed_apps = [
"fbv",
"tests.apps.Config",
]
middlewares = [
"fbv.middleware.RequestMethodMiddleware",
]
settings.configure(
BASE_DIR=Path("tests"),
SECRET_KEY="this-is-a-secret",
TEMPLATES=templates,
ROOT_URLCONF="tests.urls",
INSTALLED_APPS=installed_apps,
UNIT_TEST=True,
MIDDLEWARE=middlewares,
DATABASES=databases,
)
django_setup()