Skip to content

Commit 9dc3eb7

Browse files
3bhmvantellingen
authored andcommitted
Fixed the test for timestamp signing
1 parent 4715b04 commit 9dc3eb7

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

tests/test_wsse_signature.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import pytest
55
from lxml.etree import QName
6-
6+
from lxml import etree
77
from tests.utils import load_xml
88
from zeep import ns, wsse
99
from zeep.exceptions import SignatureVerificationFailed
@@ -30,24 +30,28 @@
3030
def test_sign_timestamp_if_present():
3131
envelope = load_xml(
3232
"""
33-
<soapenv:Envelope
34-
xmlns:tns="http://tests.python-zeep.org/"
35-
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
36-
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
33+
<soap-env:Envelope
34+
xmlns:ns0="http://example.com/stockquote.xsd"
3735
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
38-
xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility">
39-
<soapenv:Header>
40-
<wsu:Timestamp>
41-
<wsu:Created>2018-11-18T15:44:27Z</wsu:Created>
42-
<wsu:Expires>2018-11-18T15:54:27Z</wsu:Expires>
43-
</wsu:Timestamp>
44-
</soapenv:Header>
45-
<soapenv:Body>
46-
<tns:Function>
47-
<tns:Argument>OK</tns:Argument>
48-
</tns:Function>
49-
</soapenv:Body>
50-
</soapenv:Envelope>
36+
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
37+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
38+
xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility"
39+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
40+
<soap-env:Header xmlns:ns0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
41+
<ns0:Security>
42+
<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
43+
<wsu:Created>2018-11-18T15:44:27Z</wsu:Created>
44+
<wsu:Expires>2018-11-18T15:54:27Z</wsu:Expires>
45+
</wsu:Timestamp>
46+
</ns0:Security>
47+
</soap-env:Header>
48+
<soap-env:Body>
49+
<ns0:TradePriceRequest>
50+
<tickerSymbol>foobar</tickerSymbol>
51+
<ns0:country/>
52+
</ns0:TradePriceRequest>
53+
</soap-env:Body>
54+
</soap-env:Envelope>
5155
"""
5256
)
5357

0 commit comments

Comments
 (0)