Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import os |
||
2 | |||
3 | from satcfdi.cfdi import CFDI |
||
4 | from tests.utils import verify_result |
||
5 | |||
6 | module = 'satcfdi' |
||
7 | current_dir = os.path.dirname(__file__) |
||
8 | |||
9 | |||
10 | def verify_invoice(invoice, path): |
||
11 | verify = verify_result( |
||
12 | data=invoice.html_str( |
||
13 | templates_path=os.path.join(current_dir, 'templates') |
||
14 | ), |
||
15 | filename=f"{path}.html" |
||
16 | ) |
||
17 | assert verify |
||
18 | |||
19 | |||
20 | def test_custom_template(): |
||
21 | xml_file = "cfdv40-ejemplo.xml" |
||
22 | cfdi = CFDI.from_file( |
||
23 | os.path.join(current_dir, 'cfdi_ejemplos/comprobante40', xml_file) |
||
24 | ) |
||
25 | |||
26 | verify_invoice(cfdi, xml_file) |
||
27 |