Fix: Test incluir ApplicationResponse

This commit is contained in:
Rodia 2025-01-01 18:40:05 -05:00
parent 7672ae4b7f
commit c49e67b8a6

View File

@ -14,6 +14,7 @@ simple_invoice = simple_invoice
def test_xml_with_required_elements(simple_invoice):
xml_header = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
DIANInvoiceXML = form_xml.DIANInvoiceXML(
simple_invoice)
@ -27,9 +28,9 @@ def test_xml_with_required_elements(simple_invoice):
DIANInvoiceXML = form_xml.DIANInvoiceXML(
simple_invoice, 'Invoice').attach_invoice
attached_document = (
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
) + DIANInvoiceXML.tostring()
ApplicationResponse = xml_header + form_xml.ApplicationResponse(simple_invoice).toFachoXML().tostring()
attached_document = xml_header + DIANInvoiceXML.tostring()
assert xml.get_element_text(
'/atd:AttachedDocument/cbc:UBLVersionID') == 'UBL 2.1'
@ -118,9 +119,7 @@ def test_xml_with_required_elements(simple_invoice):
assert xml.get_element_text(
'/atd:AttachedDocument/cac:ParentDocumentLineReference/cac:DocumentReference/cac:Attachment/cac:ExternalReference/cbc:EncodingCode'
) == "UTF-8"
# assert xml.get_element_text(
# '/atd:AttachedDocument/cac:ParentDocumentLineReference/cac:DocumentReference/cac:Attachment/cac:ExternalReference/cbc:Description'
# ) == " "
with open("output.xml", "w") as fh:
fh.write(xml.tostring())
assert xml.get_element_text(
'/atd:AttachedDocument/cac:ParentDocumentLineReference/cac:DocumentReference/cac:Attachment/cac:ExternalReference/cbc:Description'
) == "<![CDATA[{}]]>".format(ApplicationResponse)