-
Notifications
You must be signed in to change notification settings - Fork 2
/
conftest.py
47 lines (43 loc) · 1.42 KB
/
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
47
from django.conf import settings
def pytest_configure():
import sys
try:
import django # NOQA
except ImportError:
print("Error: django not installed")
sys.exit(1)
settings.configure(
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'tests.app',
'xff',
],
MIDDLEWARE_CLASSES=(
'xff.middleware.XForwardedForMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
),
MIDDLEWARE=(
'xff.middleware.XForwardedForMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
),
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
},
ROOT_URLCONF='tests.app.urls',
DEBUG=True,
TEMPLATE_DEBUG=True,
LOGGING={},
XFF_EXEMPT_URLS=[r'^health/$']
)