From 8d460764276fbffed29ab3062a6b4bfb5fc43c66 Mon Sep 17 00:00:00 2001 From: "bit4bit@riseup.net" Date: Sun, 31 May 2020 01:57:11 +0000 Subject: [PATCH] codelist TipoDocumento FossilOrigin-Name: 684b4eb4bd85be7cc7cf73a04b04ec0c16b49e6340d61688779d48d1bdfc7424 --- facho/fe/data/dian/codelist/__init__.py | 10 +++++++--- tests/test_data.py | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/facho/fe/data/dian/codelist/__init__.py b/facho/fe/data/dian/codelist/__init__.py index da282ce..e030b78 100644 --- a/facho/fe/data/dian/codelist/__init__.py +++ b/facho/fe/data/dian/codelist/__init__.py @@ -56,6 +56,10 @@ __all__ = ['TipoOrganizacion', 'TipoResponsabilidad', 'TipoAmbiente'] -TipoOrganizacion = CodeList(os.path.join(DATA_DIR, 'TipoOrganizacion-2.1.gc'), 'name') -TipoResponsabilidad = CodeList(os.path.join(DATA_DIR, 'TipoResponsabilidad-2.1.gc'), 'name') -TipoAmbiente = CodeList(os.path.join(DATA_DIR, 'TipoAmbiente-2.1.gc'), 'name') +def path_for_codelist(name): + return os.path.join(DATA_DIR, name) + +TipoOrganizacion = CodeList(path_for_codelist('TipoOrganizacion-2.1.gc'), 'name') +TipoResponsabilidad = CodeList(path_for_codelist('TipoResponsabilidad-2.1.gc'), 'name') +TipoAmbiente = CodeList(path_for_codelist('TipoAmbiente-2.1.gc'), 'name') +TipoDocumento = CodeList(path_for_codelist('TipoDocumento-2.1.gc'), 'name') diff --git a/tests/test_data.py b/tests/test_data.py index be0d3f0..8991133 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -8,9 +8,14 @@ import pytest from facho.fe.data.dian import codelist -def test_dian(): +def test_tiporesponsabilidad(): assert codelist.TipoResponsabilidad.short_name == 'TipoResponsabilidad' assert codelist.TipoResponsabilidad['Autorretenedor']['name'] == 'Autorretenedor' +def test_tipoorganizacion(): assert codelist.TipoOrganizacion.short_name == 'TipoOrganizacion' assert codelist.TipoOrganizacion['Persona Natural']['name'] == 'Persona Natural' + +def test_tipodocumento(): + assert codelist.TipoDocumento.short_name == 'TipoDocumento' + assert codelist.TipoDocumento['Factura de Venta Nacional']['code'] == '01'