【发布时间】:2021-04-13 11:56:14
【问题描述】:
在 django urls.py 上
url(r'soap/<str:user_id>/',
DjangoView.as_view(application=provider)),
关于views.py
@ rpc(_returns=AnyDict)
def super_test_dict(self, one, two):
user_id = 1 #here need to receive the user_id
res = {"user_id":user_id}
return res
关于tests.py
self.soap_client = DjangoTestClient(
f'/soap/{org.str:user_id}/', provider)
res = self.soap_client.service.super_test_dict()
问题是当我发送参数 str:user_id 不起作用,但如果没有发送任何正常工作,我需要发送与请求相同的参数但还需要在 url 上发送 str:user_id。
【问题讨论】:
标签: django xml soap url-parameters spyne