forked from antonagestam/django-text
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
executable file
·52 lines (46 loc) · 1.37 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from django.conf import settings
from django import setup
from django.test.runner import DiscoverRunner
settings.configure(**{
'DEBUG': True,
'TEMPLATE_DEBUG': True,
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
'INSTALLED_APPS': (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.staticfiles',
'text',
),
'TEMPLATE_DIRS': (
os.path.join(os.path.dirname(__file__), 'text', 'templates'),
os.path.join(os.path.dirname(__file__), 'text', 'tests', 'templates'),
),
'TEMPLATE_CONTEXT_PROCESSORS': (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.request',
),
'MIDDLEWARE_CLASSES': (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'text.middleware.TextMiddleware',
'text.middleware.ToolbarMiddleware',
),
'ROOT_URLCONF': 'text.tests.urls',
'STATIC_URL': '/static/'
})
if __name__ == "__main__":
setup()
failures = DiscoverRunner(verbosity=1).run_tests(['text'])
if failures:
sys.exit(failures)