test_utils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:django-unload 作者: Styria-Digital 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号