From f579c4e539f809089d5891851443478f151d6bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 25 Feb 2026 18:54:40 +0100 Subject: [PATCH] Test the processing of received Peppol invoice from Peppyrus --- .../scenario_edocument_peppol_peppyrus.rst | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 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 c2005fc51d..e771cf1ab1 100644 --- a/modules/edocument_peppol_peppyrus/tests/scenario_edocument_peppol_peppyrus.rst +++ b/modules/edocument_peppol_peppyrus/tests/scenario_edocument_peppol_peppyrus.rst @@ -6,10 +6,12 @@ Imports:: >>> import os >>> import time + >>> from decimal import Decimal >>> from unittest.mock import patch >>> from proteus import Model - >>> from trytond.modules.company.tests.tools import create_company + >>> from trytond.modules.account.tests.tools import create_chart, create_tax + >>> from trytond.modules.company.tests.tools import create_company, get_company >>> from trytond.modules.edocument_peppol.edocument import Peppol >>> from trytond.tests.tools import activate_modules, assertTrue >>> from trytond.tools import file_open @@ -33,12 +35,28 @@ Patch Peppol:: Activate modules:: - >>> config = activate_modules('edocument_peppol_peppyrus', create_company) + >>> config = activate_modules( + ... 'edocument_peppol_peppyrus', create_company, create_chart) >>> Cron = Model.get('ir.cron') >>> Peppol = Model.get('edocument.peppol') >>> PeppolService = Model.get('edocument.peppol.service') +Setup company:: + + >>> company = get_company() + >>> _ = company.party.identifiers.new(type='eu_vat', code=participant_vat) + >>> company.party.save() + >>> company.currency.code = 'EUR' + >>> company.currency.save() + +Setup accounting:: + + >>> tax = create_tax(Decimal('.1')) + >>> tax.unece_code = 'VAT' + >>> tax.unece_category_code = 'S' + >>> tax.save() + Create a service:: >>> peppol_service = PeppolService(sequence=1) @@ -82,5 +100,6 @@ Fetch messages:: ... if bool(Peppol.find([('direction', '=', 'in')])): ... break ... time.sleep(FETCH_SLEEP) - >>> bool(Peppol.find([('direction', '=', 'in')])) - True + >>> peppol, = Peppol.find([('direction', '=', 'in')], limit=1) + >>> peppol.state + 'succeeded'