def test_jsonrpc_invalid_request_3(live_server):
# Bad value for payload member 'jsonrpc'
headers = {'content-type': 'application/json'}
payload = {
"method": 'add',
"params": [5, 6],
"jsonrpc": "1.0",
"id": random.randint(1, 1000),
}
req_data = json.dumps(payload, cls=DjangoJSONEncoder)
response = requests.post(live_server.url + '/all-rpc/', data=req_data, headers=headers).json()
assert 'The attribute "jsonrpc" must contain "2.0"' in response['error']['message']
assert RPC_INVALID_REQUEST == response['error']['code']
评论列表
文章目录