From e6da864e54e3fdeb562a0ff644bbe1466eaf6628 Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Tue, 9 Apr 2024 15:34:26 +0100 Subject: [PATCH] fix: remove pretty format internal xml The internal xml doesn't need to be formatted. --- apps/billing/services/processor_service.py | 2 +- .../tests/test_sagex3_processor_data.py | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/billing/services/processor_service.py b/apps/billing/services/processor_service.py index 618671a..873ab4f 100644 --- a/apps/billing/services/processor_service.py +++ b/apps/billing/services/processor_service.py @@ -153,7 +153,7 @@ def __generate_data(self) -> str: {items_as_xml} """ - objectXML = self.__class__._pretty_format_xml(objectXML, space="\t") + # objectXML = self.__class__._pretty_format_xml(objectXML, space="\t") data = f""" ") - object_xml_without_1st_line = object_xml[param_idx:] - - self.assertEqual(object_xml_without_1st_line, pretty) + # def test_data_object_xml_is_formatted(self): + # """ + # Test the SageX3Processor for a custom series. + # """ + # transaction = TransactionFactory() + # SageX3TransactionInformationFactory(transaction=transaction, series="Some") + # xml = SageX3Processor(transaction).data + # root = ET.fromstring(xml) # nosec + # object_xml: str = root.findall(".//*/objectXml")[0].text.strip() + + # # pretty + # element = ET.XML(object_xml) + # ET.indent(element, space="\t") + # pretty = ET.tostring(element, encoding="unicode") + + # param_idx = object_xml.index("") + # object_xml_without_1st_line = object_xml[param_idx:] + + # self.assertEqual(object_xml_without_1st_line, pretty) # TODO test each items