Skip to content

Commit

Permalink
[REF] l10n_it_fatturapa_pec: Test one button to validate, export and …
Browse files Browse the repository at this point in the history
…send
  • Loading branch information
SirTakobi committed Jul 18, 2022
1 parent e4e2513 commit ce442f2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions l10n_it_fatturapa_pec/tests/test_e_invoice_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,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')

0 comments on commit ce442f2

Please sign in to comment.