diff options
author | Matt Lenc <mattl@incuna.com> | 2014-06-18 12:27:54 +0100 |
---|---|---|
committer | Matt Lenc <mattl@incuna.com> | 2014-06-18 12:27:54 +0100 |
commit | 3898e56c1f8a4cceea21e2628fdb7d93f97ca615 (patch) | |
tree | fe40487b8580843f2e15eaa2c9b8c15594b727b8 /wkhtmltopdf | |
parent | 6819627b1748a1cf367238015a0aec1df2a1bed3 (diff) | |
download | django-wkhtmltopdf-3898e56c1f8a4cceea21e2628fdb7d93f97ca615.tar.gz django-wkhtmltopdf-3898e56c1f8a4cceea21e2628fdb7d93f97ca615.tar.bz2 django-wkhtmltopdf-3898e56c1f8a4cceea21e2628fdb7d93f97ca615.zip |
Make teh tests run right
Because Django 1.6 and other fireworks.
Diffstat (limited to 'wkhtmltopdf')
-rw-r--r-- | wkhtmltopdf/test_settings.py | 30 | ||||
-rw-r--r-- | wkhtmltopdf/tests/run.py | 43 |
2 files changed, 43 insertions, 30 deletions
diff --git a/wkhtmltopdf/test_settings.py b/wkhtmltopdf/test_settings.py deleted file mode 100644 index 16fb734..0000000 --- a/wkhtmltopdf/test_settings.py +++ /dev/null @@ -1,30 +0,0 @@ -import os - -DEBUG = True - -DIRNAME = os.path.abspath(os.path.dirname(__file__)) - -SECRET_KEY = 'fooooooo' - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': ':memory:', - } -} - -MEDIA_ROOT = os.path.join(DIRNAME, 'media') -MEDIA_URL = '/media/' -STATIC_ROOT = os.path.join(DIRNAME, 'static') -STATIC_URL = '/static/' - -INSTALLED_APPS = ( - 'wkhtmltopdf.tests', - 'wkhtmltopdf', -) - -TEMPLATE_DIRS = [ - os.path.join(DIRNAME, 'testproject', 'tests', 'templates'), -] - -WKHTMLTOPDF_DEBUG = DEBUG diff --git a/wkhtmltopdf/tests/run.py b/wkhtmltopdf/tests/run.py new file mode 100644 index 0000000..239f5dc --- /dev/null +++ b/wkhtmltopdf/tests/run.py @@ -0,0 +1,43 @@ +#! /usr/bin/env python +import os +import sys + +from colour_runner.django_runner import ColourRunnerMixin +from django.conf import settings + +DIRNAME = os.path.abspath(os.path.dirname(__file__)) + + +settings.configure( + DEBUG=True, + DATABASES={ + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': ':memory:', + } + }, + INSTALLED_APPS=( + 'wkhtmltopdf.tests', + 'wkhtmltopdf', + ), + MEDIA_ROOT=os.path.join(DIRNAME, 'media'), + MEDIA_URL='/media/', + STATIC_ROOT=os.path.join(DIRNAME, 'static'), + STATIC_URL='/static/', + WKHTMLTOPDF_DEBUG=True, +) + +try: + from django.test.runner import DiscoverRunner +except ImportError: + from discover_runner.runner import DiscoverRunner + + +class TestRunner(ColourRunnerMixin, DiscoverRunner): + pass + + +test_runner = TestRunner(verbosity=1) +failures = test_runner.run_tests(['wkhtmltopdf']) +if failures: + sys.exit(1) |