Skip to content
Browse files

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.
  • Loading branch information...
1 parent 80d8f70 commit 9dc89cc9642a71bbb069d636e369131ce69d4e8e @sertacyildiz sertacyildiz committed with aaugustin Jan 19, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 tests/test_integration.py
View
6 tests/test_integration.py
@@ -80,6 +80,12 @@ def test_middleware_view_only(self):
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):

0 comments on commit 9dc89cc

Please sign in to comment.
Something went wrong with that request. Please try again.