def test_can_specify_limits_through_settings_for_django_test_client(
db, settings, client, method, limit, value, cfg_key, items_name,
view_ctx):
settings.PERFORMANCE_LIMITS = {
'django.test.client.Client': {
cfg_key: {
'total': limit
}
}
}
with view_ctx(value=value) as vctx:
with pytest.raises(LimitViolationError) as excinfo:
vctx.request(getattr(client, method.lower()))
assert excinfo.value.context == {
'Client.request': ['{method} {url}'.format(
url=vctx.url, method=method)]}
assert excinfo.value.items_name == items_name, \
excinfo.value.base_error_msg
test_integrates_with_django_test_client.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录