Files
ncf_manager/tests/test_module.py
T

33 lines
961 B
Python

from pathlib import Path
from trytond.tests.test_tryton import ModuleTestCase
from trytond.modules.ncf_manager.report import InvoiceReport
class NcfManagerTestCase(ModuleTestCase):
"Test Ncf Manager module"
module = 'ncf_manager'
def test_fiscal_report_overrides_single_invoice_action(self):
report_xml = (Path(__file__).parent.parent / 'invoice.xml').read_text()
self.assertIn('id="account_invoice.report_invoice"', report_xml)
self.assertIn('ncf_manager/invoice.fodt', report_xml)
self.assertNotIn('ir.action.keyword', report_xml)
def test_fiscal_report_resolves_ncf_label(self):
class Invoice:
ncf_type = '31'
@staticmethod
def _ncf_type_label_map():
return {'31': 'Factura de Crédito Fiscal'}
self.assertEqual(
InvoiceReport._get_ncf_type_name(Invoice()),
'Factura de Crédito Fiscal')
del ModuleTestCase