-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
conftest.py
43 lines (36 loc) · 1.11 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
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.contenttypes',
'elevate',
]
MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
]
def pytest_report_header(config):
return 'made with love: <3'
def pytest_configure(config):
from django.conf import settings
settings.configure(
AUTHENTICATION_BACKENDS=[
'tests.base.FooPasswordBackend',
'tests.base.StubPasswordBackend',
],
DEBUG=True,
DATABASE_ENGINE='sqlite3',
DATABASES={
'default': {
'NAME': ':memory:',
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': ':memory:',
},
},
DATABASE_NAME=':memory:',
TEST_DATABASE_NAME=':memory:',
INSTALLED_APPS=INSTALLED_APPS,
MIDDLEWARE_CLASSES=MIDDLEWARE_CLASSES,
PASSWORD_HASHERS=['django.contrib.auth.hashers.MD5PasswordHasher'],
ROOT_URLCONF='tests.urls',
SECRET_KEY='test',
)