From 7111131981bf4b312d8d2a3144cc56a7185ac0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 8 Dec 2025 22:59:18 +0100 Subject: [PATCH] Support a distinct VAT from the participant ID in the test scenario --- .../tests/scenario_edocument_peppol_peppyrus.rst | 3 ++- modules/edocument_peppol_peppyrus/tests/test_scenario.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/edocument_peppol_peppyrus/tests/scenario_edocument_peppol_peppyrus.rst b/modules/edocument_peppol_peppyrus/tests/scenario_edocument_peppol_peppyrus.rst index 4b7404d239..96877189ed 100644 --- a/modules/edocument_peppol_peppyrus/tests/scenario_edocument_peppol_peppyrus.rst +++ b/modules/edocument_peppol_peppyrus/tests/scenario_edocument_peppol_peppyrus.rst @@ -19,12 +19,13 @@ Patch Peppol:: >>> render = patch.object(Peppol, 'render').start() >>> participant_scheme, participant_id = ( ... os.getenv('PEPPYRUS_PARTICIPANT_ID').split(':', 1)) + >>> participant_vat = os.getenv('PEPPYRUS_PARTICIPANT_VAT') >>> with file_open('edocument_peppol_peppyrus/tests/invoice.xml', mode='r') as fp: ... render.return_value = ( ... fp.read() ... .replace('PARTICIPANT_SCHEME', participant_scheme) ... .replace('PARTICIPANT_ID', participant_id) - ... .replace('PARTICIPANT_VAT', participant_id.upper()) + ... .replace('PARTICIPANT_VAT', participant_vat.upper()) ... .encode()) Activate modules:: diff --git a/modules/edocument_peppol_peppyrus/tests/test_scenario.py b/modules/edocument_peppol_peppyrus/tests/test_scenario.py index b5be9b6307..92652b668e 100644 --- a/modules/edocument_peppol_peppyrus/tests/test_scenario.py +++ b/modules/edocument_peppol_peppyrus/tests/test_scenario.py @@ -9,7 +9,8 @@ from trytond.tests.test_tryton import TEST_NETWORK, load_doc_tests def load_tests(*args, **kwargs): if (not TEST_NETWORK or not (os.getenv('PEPPYRUS_API_KEY') - and os.getenv('PEPPYRUS_PARTICIPANT_ID'))): + and os.getenv('PEPPYRUS_PARTICIPANT_ID') + and os.getenv('PEPPYRUS_PARTICIPANT_VAT'))): kwargs.setdefault('skips', set()).update({ 'scenario_edocument_peppol_peppyrus.rst', })