Add test signartime - timezone America/Bogota
This commit is contained in:
parent
fb44498e53
commit
30773e042b
1
.gitignore
vendored
1
.gitignore
vendored
@ -215,3 +215,4 @@ tags
|
||||
pyvenv.cfg
|
||||
.venv
|
||||
pip-selfcheck.json
|
||||
invoice.xml
|
@ -1,6 +1,9 @@
|
||||
# DERIVADO DE https://alextereshenkov.github.io/run-python-tests-with-tox-in-docker.html
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ENV TZ=America/Bogota
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get -qq update
|
||||
|
||||
RUN apt install software-properties-common -y \
|
||||
|
2
setup.py
2
setup.py
@ -18,7 +18,7 @@ requirements = ['Click>=8.1.7',
|
||||
'lxml==5.2.2',
|
||||
'cryptography==42.0.8',
|
||||
'pyOpenSSL==24.1.0',
|
||||
'xmlsig==1.0.1',
|
||||
'xmlsig==0.1.7',
|
||||
'xades==1.0.0',
|
||||
'xmlsec==1.3.14',
|
||||
# usamos esta dependencia en runtime
|
||||
|
@ -116,3 +116,20 @@ def test_xml_sign_dian_using_bytes(monkeypatch):
|
||||
|
||||
xmlsigned = signer.sign_xml_string(xmlstring)
|
||||
assert "Signature" in xmlsigned
|
||||
|
||||
def test_xml_signature_timestamp(monkeypatch):
|
||||
xml = fe.FeXML(
|
||||
'Invoice',
|
||||
'http://www.dian.gov.co/contratos/facturaelectronica/v1')
|
||||
xml.find_or_create_element(
|
||||
'/fe:Invoice/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent')
|
||||
ublextension = xml.fragment(
|
||||
'/fe:Invoice/ext:UBLExtensions/ext:UBLExtension', append=True)
|
||||
ublextension.find_or_create_element(
|
||||
'/ext:UBLExtension/ext:ExtensionContent')
|
||||
xmlstring = xml.tostring()
|
||||
signer = fe.DianXMLExtensionSigner('./tests/example.p12')
|
||||
xmlsigned = signer.sign_xml_string(xmlstring)
|
||||
|
||||
with open('invoice.xml', 'w') as file_:
|
||||
file_.write(xmlsigned)
|
Loading…
Reference in New Issue
Block a user