title: How to test (using unittest) the HTML output of a Django view?
body: <p>I'm writing unit tests for my Django application. However, I don't know how to test the HTML output of a view.</p>
  
  <p>Sometimes I might want to check if a specific element contains certain value, or how many of those elements are displayed, or things like that. How can I do such tests?</p>
  
  <p>I would like a solution that uses <code>unittest</code> and django's own <code>django.test</code>.</p>
  
  <p>I know I can use <a href="http://seleniumhq.org/" rel="noreferrer">Selenium</a> or <a href="http://pyccuracy.org/" rel="noreferrer">Pyccuracy</a> (which uses Selenium), but Selenium tests are quite slow because of the huge overhead of launching a browser. Also, unit tests work out-of-the-box with <a href="https://bitbucket.org/kmike/django-coverage/src" rel="noreferrer">django-coverage</a> package.</p>