def should_find_something(self):
    response = self.client.get('/path/to/resource/pk/')
self.assertContains(response, '<td id="pk">the pk string</td>', status_code=200
    )
How to test (using unittest) the HTML output of a Django view?