Login

Snippets by tin_nqn

Snippet List

Load response.content in browser (for debugging)

When debugging tests you frequently need to inspect response content, making a pdb. set_trace() breakpoint and printing response.content but html isn't enough human readable (even for programmers :D) so, why not open it in your browser? Suposse you save this code in utils.py and you break your testcase as this: response = self.client.get(self.url) import pdb; pdb.set_trace() Then: (pdb) from utils import load_response_on_firefox (pdb) load_response_on_firefox(response) Ta-Da!

  • debug
  • testing
  • response
  • response.content
Read More

tin_nqn has posted 1 snippet.