Skip to content

Commit

Permalink
Added response content-length testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Mar 15, 2018
1 parent dc31db1 commit 2445206
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ def test_graphiql(self, *args):
self.middleware.process_view(request, self.view_func, (), {})

response_mock = HttpResponse()
response_mock['Content-Length'] = 0

response = self.middleware.process_response(request, response_mock)

self.assertGreater(int(response['Content-Length']), 0)
self.assertIn(b'debug-toolbar-parse', response.content)

@patch('debug_toolbar.middleware.show_toolbar', return_value=True)
Expand Down

0 comments on commit 2445206

Please sign in to comment.