'Tests for bug #11193 (errors inside middleware shouldn\'t leave
the initLock locked).'

def test_lock_safety(self):

    old_middleware_classes = settings.MIDDLEWARE_CLASSES
    settings.MIDDLEWARE_CLASSES = 42
    handler = WSGIHandler()
    self.assertEqual(handler.initLock.locked(), False)
    try:
        handler(None, None)
    except:
        pass
    self.assertEqual(handler.initLock.locked(), False)
    settings.MIDDLEWARE_CLASSES = old_middleware_classes
