def test_has_support_for_number_of_queries_in_templates(db, settings):
settings.PERFORMANCE_LIMITS = {
'Template.render': {
'queries': {
'total': 0
}
}
}
template = loader.get_template('all-group-names.markdown')
with pytest.raises(LimitViolationError) as excinfo:
template.render(context={'groups': Group.objects.all()})
assert excinfo.value.context == {'template': ['all-group-names.markdown']}
test_integrates_with_template_rendering.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录