Skip to content

Commit

Permalink
Updated Contabilidad
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed May 7, 2024
1 parent b63294b commit 859eb4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions satcfdi/xelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def copy(self) -> 'XElement':
@classmethod
def from_xml(cls, xml_root) -> 'XElement':
obj = cfdi_objectify[xml_root.tag](cls, xml_root)
if not isinstance(obj, XElement):
obj = XElement(obj)
if not isinstance(obj, cls):
obj = cls(obj)
obj.tag = xml_root.tag
return obj

Expand Down
8 changes: 4 additions & 4 deletions tests/test_create_pld.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from datetime import date

import pytest
from satcfdi.xelement import XElement

from satcfdi import render
from satcfdi.cfdi import CFDI
from satcfdi.exceptions import SchemaValidationError
from satcfdi.create.pld import ari
from tests.utils import verify_result, XElementPrettyPrinter
Expand All @@ -30,14 +30,14 @@ def test_ejemplos():
pld_ejemplos_dir = os.path.join(current_dir, 'pdl', 'ejemplos')

for file in os.listdir(pld_ejemplos_dir):
ejemplo = CFDI.from_file(os.path.join(pld_ejemplos_dir, file))
ejemplo = XElement.from_file(os.path.join(pld_ejemplos_dir, file))

verify_invoice(ejemplo, path=f"ejemplos/{file}")


def test_arrendamiento_de_inmuebles_zeros():
ari_file = os.path.join(current_dir, 'pdl', 'ejemplo_ari_zeros.xml')
report_f = CFDI.from_file(ari_file)
report_f = XElement.from_file(ari_file)

report_a = ari.Archivo(
informe=ari.InformeType(
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_arrendamiento_de_inmuebles_zeros_invalid():

def test_arrendamiento_de_inmuebles():
ari_file = os.path.join(current_dir, 'pdl', 'ejemplo_ari.xml')
report_f = CFDI.from_file(ari_file)
report_f = XElement.from_file(ari_file)

report_a = ari.Archivo(
informe=ari.InformeType(
Expand Down

0 comments on commit 859eb4b

Please sign in to comment.