Skip to content

Commit

Permalink
fixed issue converting regimen
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed Oct 12, 2023
1 parent 6260f54 commit 86e7778
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions satcfdi/csf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def _request_constancia(rfc: str, id_cif: str):


def _find_regimen(regimen):
regimen = regimen.rstrip('.')
for k, v in select_all('C756_c_RegimenFiscal').items():
if regimen.endswith(v):
return Code(k, v)
Expand Down
7 changes: 6 additions & 1 deletion tests/test_csf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest


from satcfdi.csf import retrieve, _parse_response
from satcfdi.csf import retrieve, _parse_response, _find_regimen
from tests.utils import verify_result

current_dir = os.path.dirname(__file__)
Expand Down Expand Up @@ -66,3 +66,8 @@ def test_parse_response(file):
res = _parse_response(data)
pprint(res)


def test_regimen_name():
res = _find_regimen('Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas.')
assert res == '625'

0 comments on commit 86e7778

Please sign in to comment.