From e7d31dd197c70de8fa205ca469db0182f42b6776 Mon Sep 17 00:00:00 2001 From: UTKARSH KUMAR Date: Tue, 27 Jul 2021 09:23:33 +0530 Subject: [PATCH 1/5] added tests and increased coverage for wsltv.py Signed-off-by: UTKARSH KUMAR --- conf/wsltv.ini | 12 +++ tests/cassettes/test_wsltv/test_main.yaml | 40 ++++++++ .../test_wsltv/test_main_ajustar.yaml | 45 +++++++++ .../test_main_condiciones_venta.yaml | 41 ++++++++ .../test_wsltv/test_main_consultar.yaml | 47 ++++++++++ .../test_main_consultar_mostrar.yaml | 87 +++++++++++++++++ .../test_wsltv/test_main_depositos.yaml | 41 ++++++++ .../test_main_generar_ajuste_fisico.yaml | 41 ++++++++ .../cassettes/test_wsltv/test_main_json.yaml | 42 +++++++++ .../test_wsltv/test_main_provincias.yaml | 50 ++++++++++ .../test_wsltv/test_main_prueba.yaml | 42 +++++++++ .../test_wsltv/test_main_puntos_venta.yaml | 41 ++++++++ .../test_wsltv/test_main_retenciones.yaml | 44 +++++++++ .../test_wsltv/test_main_tributos.yaml | 49 ++++++++++ tests/cassettes/test_wsltv/test_main_ult.yaml | 40 ++++++++ .../test_wsltv/test_main_variedades.yaml | 47 ++++++++++ tests/test_wsltv.py | 94 ++++++++++++++++++- ...tv_aut_test.xml => wsltv_aut_test_pdf.xml} | 0 wsltv.py | 22 +++-- 19 files changed, 816 insertions(+), 9 deletions(-) create mode 100644 conf/wsltv.ini create mode 100644 tests/cassettes/test_wsltv/test_main.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_ajustar.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_condiciones_venta.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_consultar.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_consultar_mostrar.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_depositos.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_generar_ajuste_fisico.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_json.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_provincias.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_prueba.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_puntos_venta.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_retenciones.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_tributos.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_ult.yaml create mode 100644 tests/cassettes/test_wsltv/test_main_variedades.yaml rename tests/xml/{wsltv_aut_test.xml => wsltv_aut_test_pdf.xml} (100%) diff --git a/conf/wsltv.ini b/conf/wsltv.ini new file mode 100644 index 000000000..1d7702459 --- /dev/null +++ b/conf/wsltv.ini @@ -0,0 +1,12 @@ +[WSAA] +CERT = reingart.crt +PRIVATEKEY = reingart.key +## URL = https: //wsaa.afip.gov.ar/ws/services/LoginCms + +[WSLTV] +CUIT = 20267565393 +INPUT = invoices.csv +OUTPUT = OUTPUT.txt +ENTRADA=entrada.txt +SALIDA=salida.txt +## URL = https: //serviciosjava.afip.gob.ar/wsltv/LtvService? Wsdl \ No newline at end of file diff --git a/tests/cassettes/test_wsltv/test_main.yaml b/tests/cassettes/test_wsltv/test_main.yaml new file mode 100644 index 000000000..7f7f2b245 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: "\n\n\n + \ \n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '240' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/dummy"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: OKOKOK + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 12:50:44 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf8bec6312e5ba91f12b538f048ee6914cbb9eda39637cfaf4a110f37c3656dbd8; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_ajustar.yaml b/tests/cassettes/test_wsltv/test_main_ajustar.yaml new file mode 100644 index 000000000..b1dbc6f08 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_ajustar.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyMzU0Mjc0OTY1IiBnZW5fdGltZT0iMTYyNjk2MDQzNyIgZXhwX3RpbWU9IjE2MjcwMDM2OTciLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==KpUWW7iOXBZbtGu0L7lZiRWRpl1hNwROQWe//vumhc57snJXSPPMTUPc01rwu3HDF/3nB5/H6Dnh/RLcvmrvxmpxgdPdasxiKMNwlPpBtU2QwnDIU5EfOaXUClqZwSZMWNyaY7XmaXrYW9JfBQrvsOQHphxgxEL1BfpeK9Fx3Tc=20267565393151132015-12-312958201C15145211234567822222222222010-01-0111141125112099Descripcion + otros tributos2210\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '2220' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/ajustarLiquidacion"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "cvc-minInclusive-valid + El valor '222222222' no cumple con la restricci\xF3n minInclusive '10000000000' + para el tipo 'Cuit'.cvc-type.3.1.3 + El valor '222222222' del elemento 'cuitReceptor' no es v\xE1lido.1004La + CUIT no registra alta en IVA." + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 13:33:52 GMT + Set-Cookie: + - TS01761d9e=01439f1ddfbfaa6694e1387190af051d8dcf6542ddcbf87602033d0a2ba2210739b6c1503a; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_condiciones_venta.yaml b/tests/cassettes/test_wsltv/test_main_condiciones_venta.yaml new file mode 100644 index 000000000..f3571ae05 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_condiciones_venta.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1283' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarCondicionesVenta"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1Contado96Cuenta + Corriente97Cheque99Otra + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:06:59 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf98b45896621d5513cc0fd5a07856e7e7a18691bead9f2bd390d8de86efc41153; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_consultar.yaml b/tests/cassettes/test_wsltv/test_main_consultar.yaml new file mode 100644 index 000000000..5cdc2164a --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_consultar.yaml @@ -0,0 +1,47 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIzMzAxMjcwNjA2IiBnZW5fdGltZT0iMTYyNjk2MTA0NiIgZXhwX3RpbWU9IjE2MjcwMDQzMDYiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==rx8jRRByWFKSuGEfeirB96QygNRVZb17y0MZhARRe/Uo/k5YodKTVyHvfF0TXOXpxebLOCoWDUQlNByknSzs7rt5D9geiiuQS51jDXfUpe598Gd1W2C1EBfkS5XH8HQ6OGiBzeZsfafZ9x7BcCYLQLtVV0A5boTS1Lt+N7uXngE=202675653931--debug0true\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1443' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarLiquidacionXNroComprobante"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "cvc-enumeration-valid + El valor '--debug' no est\xE1 inclu\xEDdo en la lista '[150, 151]'. Debe tener + un valor de la lista.cvc-type.3.1.3 + El valor '--debug' del elemento 'tipoComprobante' no es v\xE1lido.cvc-minInclusive-valid + El valor '0' no cumple con la restricci\xF3n minInclusive '1' para el tipo + 'NroComprobante'.cvc-type.3.1.3 + El valor '0' del elemento 'nroComprobante' no es v\xE1lido.500Error + general de aplicaci\xF3n." + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 13:40:01 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf06c59185014399abe98d2ac04b4c015b7fd2765bb9ac66d9011104d5ed69eac2; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_consultar_mostrar.yaml b/tests/cassettes/test_wsltv/test_main_consultar_mostrar.yaml new file mode 100644 index 000000000..12470bedc --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_consultar_mostrar.yaml @@ -0,0 +1,87 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIzMzAxMjcwNjA2IiBnZW5fdGltZT0iMTYyNjk2MTA0NiIgZXhwX3RpbWU9IjE2MjcwMDQzMDYiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==rx8jRRByWFKSuGEfeirB96QygNRVZb17y0MZhARRe/Uo/k5YodKTVyHvfF0TXOXpxebLOCoWDUQlNByknSzs7rt5D9geiiuQS51jDXfUpe598Gd1W2C1EBfkS5XH8HQ6OGiBzeZsfafZ9x7BcCYLQLtVV0A5boTS1Lt+N7uXngE=202675653931501610002016-04-18CPS99otraBR122656986612FFAA778882016-04-012011111111212345611223223212015-12-103564900419015otra + retencion1299Ganancias1500081200transporte1000.010.0100.0\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '2694' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/generarLiquidacion"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1004La + CUIT no registra alta en IVA. + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 13:41:49 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf0f0bf829da65e0cf33eee267d82d31adcdc59d7bc54b16b1c7cc6a692f6277e8; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIzMzAxMjcwNjA2IiBnZW5fdGltZT0iMTYyNjk2MTA0NiIgZXhwX3RpbWU9IjE2MjcwMDQzMDYiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==rx8jRRByWFKSuGEfeirB96QygNRVZb17y0MZhARRe/Uo/k5YodKTVyHvfF0TXOXpxebLOCoWDUQlNByknSzs7rt5D9geiiuQS51jDXfUpe598Gd1W2C1EBfkS5XH8HQ6OGiBzeZsfafZ9x7BcCYLQLtVV0A5boTS1Lt+N7uXngE=202675653931--mostrar0true\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1445' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarLiquidacionXNroComprobante"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "cvc-enumeration-valid + El valor '--mostrar' no est\xE1 inclu\xEDdo en la lista '[150, 151]'. Debe + tener un valor de la lista.cvc-type.3.1.3 + El valor '--mostrar' del elemento 'tipoComprobante' no es v\xE1lido.cvc-minInclusive-valid + El valor '0' no cumple con la restricci\xF3n minInclusive '1' para el tipo + 'NroComprobante'.cvc-type.3.1.3 + El valor '0' del elemento 'nroComprobante' no es v\xE1lido.500Error + general de aplicaci\xF3n." + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 13:41:51 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf5667325da30f1c836ad50a1263a4569d1e9823ac1af93defec53da0ffae3a230; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_depositos.yaml b/tests/cassettes/test_wsltv/test_main_depositos.yaml new file mode 100644 index 000000000..f76dd9ec7 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_depositos.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1281' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarDepositosAcopio"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1000ALVEAR + 227LUJAN DE CUYO5507 + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:13:18 GMT + Set-Cookie: + - TS01761d9e=01439f1ddfc62656bc11e36465602725cce3c62c6afe744da18439b1dd31fa5e39ec289512; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_generar_ajuste_fisico.yaml b/tests/cassettes/test_wsltv/test_main_generar_ajuste_fisico.yaml new file mode 100644 index 000000000..3e57178d0 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_generar_ajuste_fisico.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyMzU0Mjc0OTY1IiBnZW5fdGltZT0iMTYyNjk2MDQzNyIgZXhwX3RpbWU9IjE2MjcwMDM2OTciLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==KpUWW7iOXBZbtGu0L7lZiRWRpl1hNwROQWe//vumhc57snJXSPPMTUPc01rwu3HDF/3nB5/H6Dnh/RLcvmrvxmpxgdPdasxiKMNwlPpBtU2QwnDIU5EfOaXUClqZwSZMWNyaY7XmaXrYW9JfBQrvsOQHphxgxEL1BfpeK9Fx3Tc=20267565393151212016-09-091900-01-0115136972\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1638' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/generarAjusteFisico"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1004La + CUIT no registra alta en IVA. + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 13:32:22 GMT + Set-Cookie: + - TS01761d9e=01439f1ddffebaefd6ba34054656f6c713e7e3265ce4c526b60904f953794d522e9730165c; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_json.yaml b/tests/cassettes/test_wsltv/test_main_json.yaml new file mode 100644 index 000000000..498941ea9 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_json.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIxNDYwNDM3NDgyIiBnZW5fdGltZT0iMTYyNjk2MTc1MyIgZXhwX3RpbWU9IjE2MjcwMDUwMTMiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==ComnznLJOdG8SWcIzorDT2Ew7A/uq9EvYrOJg/4rRQHZ8M1VC3hK8CMjJHf28GDY1G+m3TUf2wBfV5JJ9ovUXmmTYPPmPyzQj2LhrPdd8UWTni+Fw9zy5zMVF94oE3QMTnqS+Qcn8bO6Dw1PFo8PkZTEYIbj7v3w1cyEXultXD0=202675653931501610002016-04-18CPS99otraBR122656986612FFAA778882016-04-012011111111212345611223223212015-12-103564900419015otra + retencion1299Ganancias1500081200transporte1000.010.0100.0\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '2694' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/generarLiquidacion"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1004La + CUIT no registra alta en IVA. + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 13:52:19 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf10e82538b5d455521649545a857329cc160dae71b1c756f5303af6781af19c1f; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_provincias.yaml b/tests/cassettes/test_wsltv/test_main_provincias.yaml new file mode 100644 index 000000000..6a4963b8e --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_provincias.yaml @@ -0,0 +1,50 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1271' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarProvincias"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1BUENOS + AIRES0CAP.FEDERAL2CATAMARCA16CHACO17CHUBUT3CORDOBA4CORRIENTES5ENTRERIOS18FORMOSA6JUJUY21LA + PAMPA8LA + RIOJA7MENDOZA19MISIONES20NEUQUEN22RIO + NEGRO9SALTA10SAN + JUAN11SAN + LUIS23SANTA + CRUZ12SANTA + FE13SGO.DEL + ESTERO24TIER.DEL + FUEGO14TUCUMAN + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:05:46 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf04e4954be1aba7b6d0982a08cb35ad46ed8a62248fe81dc24891d42b2a517162; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_prueba.yaml b/tests/cassettes/test_wsltv/test_main_prueba.yaml new file mode 100644 index 000000000..6514ca3fe --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_prueba.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIzMjIwODYzOTQ2IiBnZW5fdGltZT0iMTYyNjk1ODAwNSIgZXhwX3RpbWU9IjE2MjcwMDEyNjUiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==XyEyoD8XDPuaDZiI5Y/8j0w+/XD7c5ggKmQUpclJp3WTgi/xPrMkYy8wxTEZJudjwHHH25+lwgBBvlZV8PFwp64Sk+psvPAwwlynGO2MB/fscFB/ezDiGjugJ5P8gk0kPSMQLJRulNG8uBhLdIrdMr1IqD9pYMP6maNFnEY0lQ8=202675653931501610002016-04-18CPS99otraBR122656986612FFAA778882016-04-012011111111212345611223223212015-12-103564900419015otra + retencion1299Ganancias1500081200transporte1000.010.0100.0\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '2694' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/generarLiquidacion"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 1004La + CUIT no registra alta en IVA. + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 12:50:47 GMT + Set-Cookie: + - TS01761d9e=01439f1ddfadc10c94d75bad4046aec823de0b05edb522795b83832330032fbc0d63a4a35a; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_puntos_venta.yaml b/tests/cassettes/test_wsltv/test_main_puntos_venta.yaml new file mode 100644 index 000000000..071e1edf6 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_puntos_venta.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1275' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarPuntosVentas"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "500Error + general de aplicaci\xF3n.No registra alta en IVA" + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:15:30 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf374a6fbac34b8626a9831b77f8aea7feadd66464fdd2546106cafbd8d1a7c710; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_retenciones.yaml b/tests/cassettes/test_wsltv/test_main_retenciones.yaml new file mode 100644 index 000000000..e2d5560c7 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_retenciones.yaml @@ -0,0 +1,44 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1295' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarRetencionesTabacaleras"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "11C\xE1mara + Tabacalera12Seguro + Granizo13Asociaci\xF3n + Mutual de Prod. Tabacaleros14Adelantos + de insumos15Otra" + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:14:23 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf028f1436105fe804d4079fb515506cbef80cd4e4ca982e47b47d4d85fc45266d; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_tributos.yaml b/tests/cassettes/test_wsltv/test_main_tributos.yaml new file mode 100644 index 000000000..3a155e61a --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_tributos.yaml @@ -0,0 +1,49 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1267' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarTributos"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "1Impuestos + nacionales 2Impuestos + provinciales 3Impuestos + municipales 4Impuestos + internos 5IIBB + 6Retenci\xF3n + de IVA7Retenci\xF3n + de IIBB8Retenciones + por Impuestos Municipales9Otras + Retenciones99Otros" + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:08:02 GMT + Set-Cookie: + - TS01761d9e=01439f1ddfcc4341665222f3df5f567b71210a7b7ed7234d892793a1121f5d224e1a916b59; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_ult.yaml b/tests/cassettes/test_wsltv/test_main_ult.yaml new file mode 100644 index 000000000..246d15e99 --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_ult.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=202675653931151\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1394' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarUltimoComprobanteXPuntoVenta"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: 0 + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:03:59 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf9acc9256479079b7787181fcf46b1da1a3557dd453b75d5ab8700827d822630d; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_wsltv/test_main_variedades.yaml b/tests/cassettes/test_wsltv/test_main_variedades.yaml new file mode 100644 index 000000000..d5d6afa3b --- /dev/null +++ b/tests/cassettes/test_wsltv/test_main_variedades.yaml @@ -0,0 +1,47 @@ +interactions: +- request: + body: "\n\n\n + \ \n PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8c3NvIHZlcnNpb249IjIuMCI+CiAgICA8aWQgc3JjPSJDTj13c2FhaG9tbywgTz1BRklQLCBDPUFSLCBTRVJJQUxOVU1CRVI9Q1VJVCAzMzY5MzQ1MDIzOSIgdW5pcXVlX2lkPSIyNjEwNzY2MDc3IiBnZW5fdGltZT0iMTYyNjk2NjA0MSIgZXhwX3RpbWU9IjE2MjcwMDkzMDEiLz4KICAgIDxvcGVyYXRpb24gdHlwZT0ibG9naW4iIHZhbHVlPSJncmFudGVkIj4KICAgICAgICA8bG9naW4gZW50aXR5PSIzMzY5MzQ1MDIzOSIgc2VydmljZT0id3NsdHYiIHVpZD0iU0VSSUFMTlVNQkVSPUNVSVQgMjAyNjc1NjUzOTMsIENOPXJlaW5nYXJ0MjAyMSIgYXV0aG1ldGhvZD0iY21zIiByZWdtZXRob2Q9IjIyIj4KICAgICAgICAgICAgPHJlbGF0aW9ucz4KICAgICAgICAgICAgICAgIDxyZWxhdGlvbiBrZXk9IjIwMjY3NTY1MzkzIiByZWx0eXBlPSI0Ii8+CiAgICAgICAgICAgIDwvcmVsYXRpb25zPgogICAgICAgIDwvbG9naW4+CiAgICA8L29wZXJhdGlvbj4KPC9zc28+Cg==fUnQ4DhRMEKaa5ap8A+aqB2M6G7W9bhRI8Hqb86VHZgE6xbcv37LxpRS3uQsOUsNM6vBhyojkwT2nU0tUaa/hpuvPbAugj+cO7Jd/z24ay2YqVMTVGne9JARBw3ZIGwDloNXicNqpqo1LBGUoAgsJ/tTT+vL6mXKo1l2xlVu5oY=20267565393\n\n" + headers: + accept-encoding: + - gzip, deflate + content-length: + - '1295' + content-type: + - text/xml; charset="UTF-8" + soapaction: + - '"http://serviciosjava.afip.gob.ar/wsltv/consultarVariedadesClasesTabaco"' + user-agent: + - Mozilla/5.0 (Windows NT 6.1; Win64; x64) + method: POST + uri: https://fwshomo.afip.gov.ar/wsltv/LtvService + response: + body: + string: "BRBurley3B1F4B1FR11B2F12B2FR22B3F23B3FR24B3K6C1F5C1L14C2F13C2L19C3F20C3K18C3L27NB25NG26NX1T1F2T1FR9T2F10T2FR17T3K8X1F7X1L16X2F15X2L21X3KCACriollo + Argentino111B1112B2113B3109C1110C2116N114T2115T4107X2108X4CHCriollo + Chaque\xF1o35CH136CH237CH338NDCCCriollo + Correntino28C129C230C334N33T31X132X2CMCriollo + Misionero41B142B239C140C245N446N543T144X1CSCriollo + Salte\xF1o50B1F49B1L53B348C1F47C1L52C356N4B55N4X54T251X2KAKentucky + Ahumado117B1118B2119B3123N2120X1121X2122X3MEMezcla105METITabaco + Importado106TIVRVirginia59B1F60B1L69B2F72B2KF71B2KL70B2L79B3F82B3KF81B3KL80B3L89B4F90B4L61C1F62C1L73C2F75C2K74C2L83C3F85C3K84C3L91C4F92C4L102H1F103H2F104H3F101N5B100N5C98N5K99N5X97NVB96NVC95NVX57T1F58T1L65T2F68T2KF67T2KL66T2L63X1F64X1L76X2F78X2K77X2L86X3F88X3K87X3L93X4F94X4L" + headers: + Connection: + - close + Content-Type: + - text/xml;charset=utf-8 + Date: + - Thu, 22 Jul 2021 15:13:12 GMT + Set-Cookie: + - TS01761d9e=01439f1ddf7cd85ea023b65ac524eed8716a2e0f9140a50a9bfc553ae79bb427b9844c3124; + Path=/ + Transfer-Encoding: + - chunked + X-Powered-By: + - Servlet/3.0; JBossAS-6 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_wsltv.py b/tests/test_wsltv.py index 6c7f7aa6c..5e07d9803 100644 --- a/tests/test_wsltv.py +++ b/tests/test_wsltv.py @@ -21,7 +21,7 @@ import os import pytest from pyafipws.wsaa import WSAA -from pyafipws.wsltv import WSLTV +from pyafipws.wsltv import WSLTV, main import sys @@ -376,3 +376,95 @@ def test_mostrar_pdf(auth): f.write(pdf) show = wsltv.MostrarPDF(archivo="liq.pdf", imprimir=True) assert show is False + +def test_main(auth): + sys.argv = [] + sys.argv.append("--dummy") + main() + + +def test_main_prueba(auth): + sys.argv = [] + sys.argv.append("--autorizar") + sys.argv.append("--prueba") + main() + +def test_main_autorizar_testing(auth): + sys.argv = [] + sys.argv.append("--autorizar") + sys.argv.append("--prueba") + sys.argv.append("--testing") + main() + +def test_main_generar_ajuste_fisico(auth): + sys.argv = [] + sys.argv.append("--generar-ajuste-fisico") + sys.argv.append("--prueba") + main() + +def test_main_ajustar(auth): + sys.argv = [] + sys.argv.append("--ajustar") + sys.argv.append("--prueba") + main() + +def test_main_consultar(auth): + sys.argv = [] + sys.argv.append("--consultar") + sys.argv.append("--debug") + main() + +def test_main_consultar_mostrar(auth): + sys.argv = [] + sys.argv.append("--autorizar") + sys.argv.append("--prueba") + sys.argv.append("--consultar") + sys.argv.append("--mostrar") + main() + +def test_main_json(auth): + sys.argv = [] + sys.argv.append("--autorizar") + sys.argv.append("--prueba") + sys.argv.append("--json") + main() + +def test_main_ult(auth): + sys.argv = [] + sys.argv.append("--ult") + main() + +def test_main_provincias(auth): + sys.argv = [] + sys.argv.append("--provincias") + main() + +def test_main_condiciones_venta(auth): + sys.argv = [] + sys.argv.append("--condicionesventa") + main() + +def test_main_tributos(auth): + sys.argv = [] + sys.argv.append("--tributos") + main() + +def test_main_retenciones(auth): + sys.argv = [] + sys.argv.append("--retenciones") + main() + +def test_main_variedades(auth): + sys.argv = [] + sys.argv.append("--variedades") + main() + +def test_main_depositos(auth): + sys.argv = [] + sys.argv.append("--depositos") + main() + +def test_main_puntos_venta(auth): + sys.argv = [] + sys.argv.append("--puntosventa") + main() \ No newline at end of file diff --git a/tests/xml/wsltv_aut_test.xml b/tests/xml/wsltv_aut_test_pdf.xml similarity index 100% rename from tests/xml/wsltv_aut_test.xml rename to tests/xml/wsltv_aut_test_pdf.xml diff --git a/wsltv.py b/wsltv.py index 6f418a21a..36c484064 100644 --- a/wsltv.py +++ b/wsltv.py @@ -104,7 +104,7 @@ DEBUG = False XML = False -CONFIG_FILE = "wsltv.ini" +CONFIG_FILE = "conf/wsltv.ini" TIMEOUT = 30 HOMO = False @@ -997,7 +997,7 @@ def main(): # genero una liquidación de ejemplo: tipo_cbte = 150 - pto_vta = 6 + pto_vta = 2002 if not "--prueba" in sys.argv: # consulto el último número de orden emitido: @@ -1135,10 +1135,16 @@ def main(): assert wsltv.GetParametro("emisor", "domicilio") == u"Peru 100" assert wsltv.GetParametro("emisor", "razon_social") == u"JOCKER" assert wsltv.GetParametro("receptor", "domicilio") == u"Calle 1" - assert ( - wsltv.GetParametro("receptor", "razon_social") - == u"CUIT PF de Prueba gen\xe9rica" - ) + if sys.version > '3': + assert ( + wsltv.GetParametro("receptor", "razon_social") + == u'CUIT PF de Prueba gen\xc3\xa9rica' + ) + else: + assert ( + wsltv.GetParametro("receptor", "razon_social") + == u'CUIT PF de Prueba genérica' + ) assert ( wsltv.GetParametro( "romaneos", 0, "detalle_clase", 0, "cantidad_fardos" @@ -1265,7 +1271,7 @@ def main(): f, sort_keys=True, indent=4, - encoding="utf-8", + # encoding="utf-8", ) if "--ult" in sys.argv: @@ -1285,7 +1291,7 @@ def main(): print(wsltv.Traceback, file=sys.stderr) print("Ultimo Nro de Comprobante", wsltv.NroComprobante) print("Errores:", wsltv.Errores) - sys.exit(0) + # sys.exit(0) # Recuperar parámetros: From 0ad03d1b8f046950b102d34e2b416dd8795adffb Mon Sep 17 00:00:00 2001 From: UTKARSH KUMAR Date: Tue, 27 Jul 2021 09:53:00 +0530 Subject: [PATCH 2/5] fixed unicode error for python 3 Signed-off-by: UTKARSH KUMAR --- wsltv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsltv.py b/wsltv.py index 36c484064..ee59e0611 100644 --- a/wsltv.py +++ b/wsltv.py @@ -1138,7 +1138,7 @@ def main(): if sys.version > '3': assert ( wsltv.GetParametro("receptor", "razon_social") - == u'CUIT PF de Prueba gen\xc3\xa9rica' + == u'CUIT PF de Prueba genérica' ) else: assert ( From 89a7c6f9a5c636e23324c1922bbb2877efa95eae Mon Sep 17 00:00:00 2001 From: UTKARSH KUMAR Date: Tue, 27 Jul 2021 10:04:35 +0530 Subject: [PATCH 3/5] reverting back to old unicode assertion for test_main_autorizar testing Signed-off-by: UTKARSH KUMAR --- wsltv.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/wsltv.py b/wsltv.py index ee59e0611..5bf35a1f8 100644 --- a/wsltv.py +++ b/wsltv.py @@ -1135,16 +1135,10 @@ def main(): assert wsltv.GetParametro("emisor", "domicilio") == u"Peru 100" assert wsltv.GetParametro("emisor", "razon_social") == u"JOCKER" assert wsltv.GetParametro("receptor", "domicilio") == u"Calle 1" - if sys.version > '3': - assert ( - wsltv.GetParametro("receptor", "razon_social") - == u'CUIT PF de Prueba genérica' - ) - else: - assert ( - wsltv.GetParametro("receptor", "razon_social") - == u'CUIT PF de Prueba genérica' - ) + assert ( + wsltv.GetParametro("receptor", "razon_social") + == u'CUIT PF de Prueba genérica' + ) assert ( wsltv.GetParametro( "romaneos", 0, "detalle_clase", 0, "cantidad_fardos" From 5c86093517893e7797023787b57115ad685c57e8 Mon Sep 17 00:00:00 2001 From: UTKARSH KUMAR Date: Fri, 13 Aug 2021 15:06:53 +0530 Subject: [PATCH 4/5] updated workflow file Signed-off-by: UTKARSH KUMAR --- .github/workflows/python-package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a93e4d282..ff084105a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,6 +46,12 @@ jobs: - name: Fix OpenSSL "dh key too small" run: | sudo cp .github/openssl.cnf /etc/ssl/openssl.cnf + - name: Copy rece.ini file + run: | + sudo cp conf/rece.ini rece.ini + - name: Copy wsltv.ini file + run: | + sudo cp conf/wsltv.ini wsltv.ini - name: Test with pytest run: | pytest --html=report.html --self-contained-html From a8d35f44f9dc10a4bdd29b2f6ab04c4df5fe4e67 Mon Sep 17 00:00:00 2001 From: UTKARSH KUMAR Date: Fri, 13 Aug 2021 15:07:27 +0530 Subject: [PATCH 5/5] added return and updated conf files location Signed-off-by: UTKARSH KUMAR --- conf/rece.ini | 8 ++++---- wsltv.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conf/rece.ini b/conf/rece.ini index bcb197368..6a3ee79ea 100644 --- a/conf/rece.ini +++ b/conf/rece.ini @@ -1,8 +1,8 @@ -# EJEMPLO de archivo de configuración de la interfaz PyAfipWs +# EJEMPLO de archivo de configuración de la interfaz PyAfipWs # DEBE CAMBIAR Certificado (CERT) y Clave Privada (PRIVATEKEY) -# Para producción debe descomentar las URL (sacar ##) -# Más información: -# http://www.sistemasagiles.com.ar/trac/wiki/ManualPyAfipWs#Configuración +# Para producción debe descomentar las URL (sacar ##) +# Más información: +# http://www.sistemasagiles.com.ar/trac/wiki/ManualPyAfipWs#Configuración [WSAA] CERT=reingart.crt diff --git a/wsltv.py b/wsltv.py index 5bf35a1f8..ba54fc26a 100644 --- a/wsltv.py +++ b/wsltv.py @@ -104,7 +104,7 @@ DEBUG = False XML = False -CONFIG_FILE = "conf/wsltv.ini" +CONFIG_FILE = "wsltv.ini" TIMEOUT = 30 HOMO = False @@ -863,7 +863,7 @@ def main(): if "--ayuda" in sys.argv: print(LICENCIA) print(AYUDA) - sys.exit(0) + return if "--formato" in sys.argv: print("Formato:") for msg, formato in []: @@ -877,7 +877,7 @@ def main(): % (clave, comienzo, longitud, tipo, dec) ) comienzo += longitud - sys.exit(0) + return if "--register" in sys.argv or "--unregister" in sys.argv: import win32com.server.register @@ -983,7 +983,7 @@ def main(): print("AppServerStatus", wsltv.AppServerStatus) print("DbServerStatus", wsltv.DbServerStatus) print("AuthServerStatus", wsltv.AuthServerStatus) - ##sys.exit(0) + return if "--json" in sys.argv and os.path.exists("wsltv.json"): # cargar un archivo de texto: @@ -1285,7 +1285,7 @@ def main(): print(wsltv.Traceback, file=sys.stderr) print("Ultimo Nro de Comprobante", wsltv.NroComprobante) print("Errores:", wsltv.Errores) - # sys.exit(0) + return # Recuperar parámetros: