本文整理汇总了Python中rest_framework.status.HTTP_413_REQUEST_ENTITY_TOO_LARGE属性的典型用法代码示例。如果您正苦于以下问题:Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE属性的具体用法?Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE怎么用?Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类rest_framework.status
的用法示例。
在下文中一共展示了status.HTTP_413_REQUEST_ENTITY_TOO_LARGE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_channel_uint8_get_too_big
# 需要导入模块: from rest_framework import status [as 别名]
# 或者: from rest_framework.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE [as 别名]
def test_channel_uint8_get_too_big(self):
""" Test getting a cutout that is over 1GB uncompressed"""
# Create request
factory = APIRequestFactory()
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/channel1/0/0:2048/0:2048/0:131/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='channel2',
resolution='0', x_range='0:2048', y_range='0:2048', z_range='0:131', t_range=None)
self.assertEqual(response.status_code, status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)
示例2: test_channel_uint16_get_too_big
# 需要导入模块: from rest_framework import status [as 别名]
# 或者: from rest_framework.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE [as 别名]
def test_channel_uint16_get_too_big(self):
""" Test getting a cutout that is over 1GB uncompressed"""
# Create request
factory = APIRequestFactory()
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/channel2/0/0:100000/0:100000/0:10000/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='channel2',
resolution='0', x_range='0:100000', y_range='0:100000', z_range='0:10000', t_range=None)
self.assertEqual(response.status_code, status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)
示例3: test_channel_uint64_get_too_big
# 需要导入模块: from rest_framework import status [as 别名]
# 或者: from rest_framework.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE [as 别名]
def test_channel_uint64_get_too_big(self):
""" Test getting a cutout that is over 1GB uncompressed"""
# Create request
factory = APIRequestFactory()
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/layer1/0/0:2048/0:2048/0:66/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='layer1',
resolution='0', x_range='0:2048', y_range='0:2048', z_range='0:66', t_range=None)
self.assertEqual(response.status_code, status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)