def test_disabled(self): mock_get_response = object() with self.assertRaises(MiddlewareNotUsed): Middleware(mock_get_response)