facho: clip.py se adiciona nuevo comand 'sign-xml'.
* facho/cli.py: adiciona nuevo comando 'sign-xml' para firmar directamente un xml. * facho/fe/fe.py (DianXMLExtensionSigner.sign_xml_string): Nuevo metodo. FossilOrigin-Name: 61920c40da14a134de6392845b3e4d98ad2b1b683093038d6161c147669127e9
This commit is contained in:
@@ -94,5 +94,15 @@ def test_dian_invoice_with_fe():
|
||||
assert "<Invoice" in xml.tostring()
|
||||
|
||||
|
||||
def test_xml_sign_dian(monkeypatch):
|
||||
xml = fe.FeXML('Invoice',
|
||||
'http://www.dian.gov.co/contratos/facturaelectronica/v1')
|
||||
xmlstring = xml.tostring()
|
||||
signer = fe.DianXMLExtensionSigner('./tests/example.p12')
|
||||
|
||||
with monkeypatch.context() as m:
|
||||
helpers.mock_urlopen(m)
|
||||
xmlsigned = signer.sign_xml_string(xmlstring)
|
||||
assert "Signature" in xmlsigned
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user