aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf/tests/run.py
diff options
context:
space:
mode:
authorCharlie Denton <charlie@meshy.co.uk>2014-06-19 11:46:18 +0100
committerCharlie Denton <charlie@meshy.co.uk>2014-06-19 11:46:18 +0100
commit8e615cf00343d61e2bf3716c66888758aeb878ed (patch)
tree9f6f4ada901749eaeddb32ac75c0955a5327c2b5 /wkhtmltopdf/tests/run.py
parent0de693a16fa35525d3adb115bf8bf21c76581d0b (diff)
parent301bef0d6931582583a156b3195b8b13f54d2875 (diff)
downloaddjango-wkhtmltopdf-8e615cf00343d61e2bf3716c66888758aeb878ed.tar.gz
django-wkhtmltopdf-8e615cf00343d61e2bf3716c66888758aeb878ed.tar.bz2
django-wkhtmltopdf-8e615cf00343d61e2bf3716c66888758aeb878ed.zip
Merge pull request #48 from incuna/python3
Add Python3 support
Diffstat (limited to 'wkhtmltopdf/tests/run.py')
-rw-r--r--wkhtmltopdf/tests/run.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/wkhtmltopdf/tests/run.py b/wkhtmltopdf/tests/run.py
new file mode 100644
index 0000000..a840e68
--- /dev/null
+++ b/wkhtmltopdf/tests/run.py
@@ -0,0 +1,38 @@
+#! /usr/bin/env python
+import os
+import sys
+
+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
+
+
+test_runner = DiscoverRunner(verbosity=1)
+failures = test_runner.run_tests(['wkhtmltopdf'])
+if failures:
+ sys.exit(1)