We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d730db8 commit 842c0d7Copy full SHA for 842c0d7
tests/test_integration.py
@@ -96,6 +96,15 @@ def get_response(request):
96
# check toolbar insertion before "</body>"
97
self.assertContains(response, "</div>\n</body>")
98
99
+ def test_middleware_no_injection_when_encoded(self):
100
+ def get_response(request):
101
+ response = HttpResponse("<html><body></body></html>")
102
+ response["Content-Encoding"] = "something"
103
+ return response
104
+
105
+ response = DebugToolbarMiddleware(get_response)(self.request)
106
+ self.assertEqual(response.content, b"<html><body></body></html>")
107
108
def test_cache_page(self):
109
# Clear the cache before testing the views. Other tests that use cached_view
110
# may run earlier and cause fewer cache calls.
0 commit comments