From 2ee21d9f0d9eaed0494f3b9cd4b5bc9beffffae5 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Mon, 18 Feb 2013 11:37:26 +0100 Subject: Implemented persistent database connections. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Anssi Kääriäinen and Karen Tracey for their inputs. --- tests/wsgi/tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/wsgi') diff --git a/tests/wsgi/tests.py b/tests/wsgi/tests.py index 9b7ee68afd..a66258d4eb 100644 --- a/tests/wsgi/tests.py +++ b/tests/wsgi/tests.py @@ -2,7 +2,9 @@ from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.core.servers.basehttp import get_internal_wsgi_application +from django.core.signals import request_started from django.core.wsgi import get_wsgi_application +from django.db import close_old_connections from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings @@ -12,6 +14,12 @@ from django.utils import six, unittest class WSGITest(TestCase): urls = "wsgi.urls" + def setUp(self): + request_started.disconnect(close_old_connections) + + def tearDown(self): + request_started.connect(close_old_connections) + def test_get_wsgi_application(self): """ Verify that ``get_wsgi_application`` returns a functioning WSGI -- cgit v1.3