def test_get_contents(self):
"""
Test the get_contents function on the master.html template. Avoid
using the DjangoTemplates class due to frequent changes between
versions.
"""
templates_dir = settings.TEMPLATES[0]['DIRS'][0]
master_html = templates_dir + '/master.html'
contents = get_contents(filepath=master_html)
self.assertIn('DOCTYPE', contents)
self.assertIn('html', contents)
self.assertIn('head', contents)
self.assertIn('title', contents)
self.assertIn('body', contents)
self.assertIn('{% block title %}', contents)
self.assertIn('{% block body %}', contents)
评论列表
文章目录