-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathruntests.py
57 lines (49 loc) · 1.45 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
import sys
import django
from django.conf import settings
urlpatterns = []
DIRNAME = os.path.dirname(__file__)
if not settings.configured:
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db'
}
},
MIDDLEWARE_CLASSES=(),
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django_pph',
),
ROOT_URLCONF='runtests',
PASSWORD_HASHERS=(
'django_pph.hashers.PolyPasswordHasher',
),
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
'pph': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': 'pph_cache',
'TIMEOUT': None,
},
'share_cache': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'share_table',
}
},
)
if hasattr(django, 'setup'):
django.setup()
if __name__ == '__main__':
from django.core.management import execute_from_command_line
if not sys.argv[1:]:
sys.argv.extend(['test', 'django_pph'])
execute_from_command_line(sys.argv)