Implemented persistent database connections.

Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
This commit is contained in:
Aymeric Augustin 2013-02-18 11:37:26 +01:00
parent d009ffe436
commit 2ee21d9f0d
16 changed files with 220 additions and 25 deletions

View file

@ -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