from django.test import SimpleTestCase class TemplatesTestCase(SimpleTestCase): def setUp(self): super(TemplatesTestCase, self).setUp() self.response_from_root_view = self.client.get('/') def test_template_usage(self): response = self.response_from_root_view self.assertTemplateUsed(response, 'dav_base/base.html') self.assertTemplateUsed(response, 'project_name.html') def test_html_head(self): response = self.response_from_root_view html_needles = ( # favicon '', # bootstrap css '', # css file for jquery.dataTables.js '', # local css file '', # jquery.js file '', # jquery.dataTables.js file '', # bootstrap js file '', ) for needle in html_needles: self.assertInHTML(needle, response.content) def test_page_footer(self): response = self.response_from_root_view html = """ """ self.assertInHTML(html, response.content)