1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #26452 -- Loaded middleware on server start rather than on first request.

This commit is contained in:
David Evans
2016-04-03 14:43:51 +01:00
committed by Tim Graham
parent 23aa700b78
commit 99bb7fcc18
4 changed files with 15 additions and 24 deletions

View File

@@ -20,19 +20,9 @@ class HandlerTests(SimpleTestCase):
def tearDown(self):
request_started.connect(close_old_connections)
# Mangle settings so the handler will fail
@override_settings(MIDDLEWARE_CLASSES=42)
def test_lock_safety(self):
"""
Tests for bug #11193 (errors inside middleware shouldn't leave
the initLock locked).
"""
# Try running the handler, it will fail in load_middleware
def test_middleware_initialized(self):
handler = WSGIHandler()
self.assertEqual(handler.initLock.locked(), False)
with self.assertRaises(Exception):
handler(None, None)
self.assertEqual(handler.initLock.locked(), False)
self.assertIsNotNone(handler._request_middleware)
def test_bad_path_info(self):
"""Tests for bug #15672 ('request' referenced before assignment)"""