Login

Snippets by ryankask1

Snippet List

View response's content in a browser while testing

I often insert `pdb.set_trace()` in my test cases to debug and examine behavior. When tests fail with assertions like `assertContains(response, 'Some text')`, it would be useful to see the response's contents in a browser window. This snippet does just that. Simply put this code in a python script on your `PYTHONPATH` and import/call the function when the debugger starts. Only tested on Ubuntu and you might want to change `URL_OPENER` to whatever you want to open the URLs. Simple, but hopefully useful.

  • debug
  • test
  • response
Read More

ryankask1 has posted 1 snippet.