summaryrefslogtreecommitdiff
path: root/addons/l10n_be_edi/tests
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_be_edi/tests
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/l10n_be_edi/tests')
-rw-r--r--addons/l10n_be_edi/tests/__init__.py3
-rw-r--r--addons/l10n_be_edi/tests/test_ubl.py28
2 files changed, 31 insertions, 0 deletions
diff --git a/addons/l10n_be_edi/tests/__init__.py b/addons/l10n_be_edi/tests/__init__.py
new file mode 100644
index 00000000..e7d057ba
--- /dev/null
+++ b/addons/l10n_be_edi/tests/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import test_ubl \ No newline at end of file
diff --git a/addons/l10n_be_edi/tests/test_ubl.py b/addons/l10n_be_edi/tests/test_ubl.py
new file mode 100644
index 00000000..c7b0917a
--- /dev/null
+++ b/addons/l10n_be_edi/tests/test_ubl.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
+
+
+class TestUBL(AccountEdiTestCommon):
+ @classmethod
+ def setUpClass(cls, chart_template_ref='l10n_be.l10nbe_chart_template', edi_format_ref='l10n_be_edi.edi_efff_1'):
+ super().setUpClass(chart_template_ref=chart_template_ref, edi_format_ref=edi_format_ref)
+
+ cls.partner_a.vat = 'BE0477472701'
+
+ def test_invoice_edi_xml_update(self):
+ invoice = self._create_empty_vendor_bill()
+ invoice_count = len(self.env['account.move'].search([]))
+ self.update_invoice_from_file('l10n_be_edi', 'test_xml_file', 'efff_test.xml', invoice)
+
+ self.assertEqual(len(self.env['account.move'].search([])), invoice_count)
+ self.assertEqual(invoice.amount_total, 666.50)
+ self.assertEqual(invoice.amount_tax, 115.67)
+ self.assertEqual(invoice.partner_id, self.partner_a)
+
+ def test_invoice_edi_xml_create(self):
+ invoice_count = len(self.env['account.move'].search([]))
+ invoice = self.create_invoice_from_file('l10n_be_edi', 'test_xml_file', 'efff_test.xml')
+ self.assertEqual(len(self.env['account.move'].search([])), invoice_count + 1)
+ self.assertEqual(invoice.amount_total, 666.50)
+ self.assertEqual(invoice.amount_tax, 115.67)
+ self.assertEqual(invoice.partner_id, self.partner_a)