From cc3b60f8c2fdcef4aecc442fe7ba11d01bbd3452 Mon Sep 17 00:00:00 2001 From: Ludvig Wadenstein Date: Sat, 18 May 2013 14:12:52 +0200 Subject: [PATCH] Added testrunner that works with django --- example/__init__.py | 0 runtests.py | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 example/__init__.py create mode 100755 runtests.py diff --git a/example/__init__.py b/example/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/runtests.py b/runtests.py new file mode 100755 index 0000000..e2e159a --- /dev/null +++ b/runtests.py @@ -0,0 +1,19 @@ +import os +import sys + +os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings' +exampleproject_dir = os.path.join(os.path.dirname(__file__), 'example') +sys.path.insert(0, exampleproject_dir) + +from django.test.utils import get_runner +from django.conf import settings + + +def runtests(): + TestRunner = get_runner(settings) + test_runner = TestRunner(verbosity=1, interactive=True) + failures = test_runner.run_tests(['blog', 'djadmin2']) + sys.exit(bool(failures)) + +if __name__ == '__main__': + runtests()