aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSertaç Ö. Yıldız2014-01-19 03:39:27 +0200
committerAymeric Augustin2014-02-13 22:09:25 +0100
commit9dc89cc9642a71bbb069d636e369131ce69d4e8e (patch)
treee5f6da9cb0372af94c149afb026042b583f86fdd /tests
parent80d8f706dec2c8ea21757a63380752818defb44e (diff)
downloaddjango-debug-toolbar-9dc89cc9642a71bbb069d636e369131ce69d4e8e.tar.bz2
Toolbar insertion test for middleware
Byte counts of "İ" and "İ".lower() are different. If the page html contains "İ", process_response() method cannot insert the toolbar content at the correct index, and breaks the page content.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_integration.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 56a2d9c..e7a4fe0 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -80,6 +80,12 @@ class DebugToolbarTestCase(BaseTestCase):
def test_middleware_response_only(self):
DebugToolbarMiddleware().process_response(self.request, self.response)
+ def test_middleware_response_insertion(self):
+ resp = regular_view(self.request, "İ")
+ DebugToolbarMiddleware().process_response(self.request, resp)
+ # check toolbar insertion before "</body>"
+ self.assertContains(resp, '</div>\n</body>')
+
@override_settings(DEBUG=True)
class DebugToolbarIntegrationTestCase(TestCase):