Fix: Test incluir ApplicationResponse
This commit is contained in:
parent
7672ae4b7f
commit
c49e67b8a6
@ -14,6 +14,7 @@ simple_invoice = simple_invoice
|
|||||||
|
|
||||||
def test_xml_with_required_elements(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(
|
DIANInvoiceXML = form_xml.DIANInvoiceXML(
|
||||||
simple_invoice)
|
simple_invoice)
|
||||||
|
|
||||||
@ -27,9 +28,9 @@ def test_xml_with_required_elements(simple_invoice):
|
|||||||
DIANInvoiceXML = form_xml.DIANInvoiceXML(
|
DIANInvoiceXML = form_xml.DIANInvoiceXML(
|
||||||
simple_invoice, 'Invoice').attach_invoice
|
simple_invoice, 'Invoice').attach_invoice
|
||||||
|
|
||||||
attached_document = (
|
ApplicationResponse = xml_header + form_xml.ApplicationResponse(simple_invoice).toFachoXML().tostring()
|
||||||
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
|
|
||||||
) + DIANInvoiceXML.tostring()
|
attached_document = xml_header + DIANInvoiceXML.tostring()
|
||||||
|
|
||||||
assert xml.get_element_text(
|
assert xml.get_element_text(
|
||||||
'/atd:AttachedDocument/cbc:UBLVersionID') == 'UBL 2.1'
|
'/atd:AttachedDocument/cbc:UBLVersionID') == 'UBL 2.1'
|
||||||
@ -118,9 +119,7 @@ def test_xml_with_required_elements(simple_invoice):
|
|||||||
assert xml.get_element_text(
|
assert xml.get_element_text(
|
||||||
'/atd:AttachedDocument/cac:ParentDocumentLineReference/cac:DocumentReference/cac:Attachment/cac:ExternalReference/cbc:EncodingCode'
|
'/atd:AttachedDocument/cac:ParentDocumentLineReference/cac:DocumentReference/cac:Attachment/cac:ExternalReference/cbc:EncodingCode'
|
||||||
) == "UTF-8"
|
) == "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:
|
assert xml.get_element_text(
|
||||||
fh.write(xml.tostring())
|
'/atd:AttachedDocument/cac:ParentDocumentLineReference/cac:DocumentReference/cac:Attachment/cac:ExternalReference/cbc:Description'
|
||||||
|
) == "<![CDATA[{}]]>".format(ApplicationResponse)
|
||||||
|
Loading…
Reference in New Issue
Block a user