我有以下方法:
def validate_find_videos(request):
radius = request.query['radius']
if not isinstance(radius, int) and not isinstance(radius, float):
raise WrongRequestData(
"Please, specify the correct type of radius value. "
"It must be a numeric value")
address = request.query['address']
if (not isinstance(address, str)):
raise WrongRequestData(
"Please, specify the correct type of address value. "
"It must be a string")
如果始终返回curl request
,如何正确测试string
参数,那么radius
将是string
而我总是会抛出WrongRequestData