forked from roverdotcom/django-inlinecss
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_tests.py
executable file
·53 lines (46 loc) · 1.54 KB
/
run_tests.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
#!/usr/bin/env python
# Short way to bootstrap Django test runner:
# taken from django-extensions (which also has
# a comment suggesting it was taken originally from
# from http://www.travisswicegood.com/2010/01/17/
# django-virtualenv-pip-and-fabric/
import os
import sys
import django
from django.conf import settings
from django.core.management import call_command
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, PROJECT_ROOT)
def main():
settings.configure(
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django_mailcss'
],
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(PROJECT_ROOT,"django_mailcss","tests","templates"),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
}],
STATIC_URL='/static/',
DEBUG=True
)
django.setup()
call_command('test', 'django_mailcss')
if __name__ == '__main__':
main()