From 2ce93f01d9995766de62bdc33dbd5377e5d82876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Tue, 21 May 2024 10:01:52 +0200 Subject: [PATCH] Test if tax identifiers are also declared as identifiers --- modules/party/tests/test_module.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/party/tests/test_module.py b/modules/party/tests/test_module.py index d800b38b5a..d3d0ab45f0 100644 --- a/modules/party/tests/test_module.py +++ b/modules/party/tests/test_module.py @@ -12,7 +12,8 @@ except ImportError: from trytond.exceptions import UserError from trytond.model.exceptions import AccessError -from trytond.modules.party.party import IDENTIFIER_TYPES +from trytond.modules.party.party import ( + IDENTIFIER_TYPES, IDENTIFIER_VAT, replace_vat) from trytond.pool import Pool from trytond.tests.test_tryton import ModuleTestCase, with_transaction from trytond.transaction import Transaction @@ -569,6 +570,13 @@ class PartyTestCase(PartyCheckEraseMixin, ModuleTestCase): set(Party.tax_identifier_types()) - set(dict(IDENTIFIER_TYPES).keys())) + @with_transaction() + def test_identifier_vat_types(self): + "Ensure VAT identifiers are identifier types" + identifiers = dict(IDENTIFIER_TYPES).keys() + vat_identifiers = set(map(replace_vat, IDENTIFIER_VAT)) + self.assertLessEqual(vat_identifiers, identifiers) + @with_transaction() def test_party_distance(self): "Test party distance"