-
Notifications
You must be signed in to change notification settings - Fork 25
/
runtests.sh
executable file
·56 lines (46 loc) · 1.35 KB
/
runtests.sh
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
#!/bin/sh
SETTINGS='settings.py'
cat > $SETTINGS <<EOF
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
MIDDLEWARE_CLASSES = MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'session_csrf.CsrfMiddleware',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.contrib.messages.context_processors.messages',
'session_csrf.context_processor',
],
},
},
]
ROOT_URLCONF = 'session_csrf.tests'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'session_csrf',
)
SECRET_KEY = 'asdf'
EOF
export PYTHONPATH=.
export DJANGO_SETTINGS_MODULE=settings
django-admin.py test session_csrf $@
return_code=$?
rm -f $SETTINGS*
exit $return_code