forked from MechanisM/django-redactorjs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtests.py
37 lines (32 loc) · 973 Bytes
/
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import django
from django.conf import settings
from django.core.management import call_command
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
opts = {
'INSTALLED_APPS': [
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.auth',
'redactor'],
'ROOT_URLCONF': 'redactor.urls',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':MEMORY:'}
},
'MIDDLEWARE_CLASSES': (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
}
settings.configure(**opts)
if django.VERSION[:2] >= (1, 7):
django.setup()
if __name__ == "__main__":
call_command('test', 'redactor')