From 50395b35b94864b05ffb1d1730a54e9760b02792 Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Thu, 14 Jul 2022 11:57:44 +0200 Subject: [PATCH] [REF] l10n_it_fatturapa_pec: Test one button to validate, export and send --- .../tests/test_e_invoice_send.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/l10n_it_fatturapa_pec/tests/test_e_invoice_send.py b/l10n_it_fatturapa_pec/tests/test_e_invoice_send.py index ad04ab1223b0..7580183ca9f6 100644 --- a/l10n_it_fatturapa_pec/tests/test_e_invoice_send.py +++ b/l10n_it_fatturapa_pec/tests/test_e_invoice_send.py @@ -108,3 +108,20 @@ def test_resend_after_regenerate(self): # Send it again e_invoice.send_to_sdi() self.assertEqual(e_invoice.state, "sent") + + def test_action_open_export_send_sdi(self): + """ + Check that the "Validate, export and send to SdI" button + sends the e-invoice. + """ + # Arrange: create a draft invoice with no attachment + invoice = self._create_invoice() + self._create_fetchmail_pec_server() + self.assertEqual(invoice.state, "draft") + self.assertFalse(invoice.fatturapa_attachment_out_id) + + # Act: open, export and send the invoice + invoice.action_open_export_send_sdi() + e_invoice = invoice.fatturapa_attachment_out_id + + self.assertEqual(e_invoice.state, "sent")