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)
评论列表
文章目录