From 4f9d011cd28267e866c819775f91024518268381 Mon Sep 17 00:00:00 2001 From: Roman Krejcik Date: Tue, 28 Jun 2011 12:52:02 +0200 Subject: [PATCH] test runner compatibility with django 1.4 --- tests/runtests.py | 14 +++++++------- tests/testproject/test_app/tests/helpers.py | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/runtests.py b/tests/runtests.py index bbe48f3..2d259c6 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -5,18 +5,18 @@ import os import sys -currentdir = os.path.dirname(os.path.abspath(__file__)) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) -sys.path.insert(0, currentdir) +testapp_dir = os.path.dirname(os.path.abspath(__file__)) +constance_dir = os.path.dirname(testapp_dir) +sys.path.insert(0, constance_dir) +sys.path.insert(0, testapp_dir) os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings' -from django.test.simple import run_tests - +from django.test.simple import DjangoTestSuiteRunner def main(): - failures = run_tests(['test_app'], verbosity=1, interactive=True) + runner = DjangoTestSuiteRunner() + failures = runner.run_tests(['test_app'], verbosity=1, interactive=True) sys.exit(failures) if __name__ == '__main__': diff --git a/tests/testproject/test_app/tests/helpers.py b/tests/testproject/test_app/tests/helpers.py index 13af783..c85c769 100644 --- a/tests/testproject/test_app/tests/helpers.py +++ b/tests/testproject/test_app/tests/helpers.py @@ -23,6 +23,7 @@ class FakeRequest(WSGIRequest): 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, + 'wsgi.input': None, } super(FakeRequest, self).__init__(environ) if user: