【发布时间】:2021-04-11 09:33:02
【问题描述】:
我尝试在 django 上使用 zeep 对 SOAP 服务进行测试(使用 Spyne),但始终需要运行 runserver,但需要在没有 runserver 的情况下执行,因为需要使用测试数据库而不是默认数据库。
我是这样使用的:
def test_obtenerListaAcciones(self):
# get actions
# this server need to be up to work, but need to be execute test without work this.
wsdl = 'http://127.0.0.1:8000/soap/getactions/'
client = zeep.Client(wsdl=wsdl)
headerArr = {}
settings = Settings(strict=False, xml_huge_tree=True,
extra_http_headers=headerArr, raw_response=True)
client = Client(wsdl,
settings=settings)
action = self.test_create_actions()
requestData = {
}
res = client.service.getactions(**requestData)
【问题讨论】:
标签: django unit-testing soap serversocket zeep