test_menu.py 文件源码

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

项目:DjangoCMS 作者: farhan711 项目源码 文件源码
def test_show_menu_num_queries(self):
        context = self.get_context()
        # test standard show_menu
        with self.assertNumQueries(7):
            """
            The queries should be:
                get all pages
                get all page permissions
                get all titles
                get the menu cache key
                create a savepoint
                set the menu cache key
                release the savepoint
            """
            tpl = Template("{% load menu_tags %}{% show_menu %}")
            tpl.render(context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号