-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] l10n_it_fatturapa_sdicoop: Test one button to validate, export …
…and send
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_account_invoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2022 Simone Rubino - TAKOBI | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.l10n_it_fatturapa_out.tests.fatturapa_common import \ | ||
FatturaPACommon | ||
|
||
|
||
class TestAccountInvoice (FatturaPACommon): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.sdi_coop_channel = self.env['sdi.channel'].create([{ | ||
'name': "Test SdiCoop channel", | ||
'channel_type': 'sdi_coop', | ||
}]) | ||
|
||
def test_action_open_export_send_sdi(self): | ||
""" | ||
Check that the "Validate, export and send to SdI" button | ||
tries to send the e-invoice. | ||
""" | ||
# Arrange: set the SdI channel | ||
# and create a draft invoice with no attachment | ||
self.env.user.company_id.sdi_channel_id = self.sdi_coop_channel | ||
invoice = self._create_invoice() | ||
self.assertEqual(invoice.state, 'draft') | ||
self.assertFalse(invoice.fatturapa_attachment_out_id) | ||
|
||
# Act and Assert: open, export and send. | ||
# This raises an exception | ||
# because sending mechanism will be implemented by depending modules | ||
with self.assertRaises(NotImplementedError): | ||
invoice.action_open_export_send_sdi() |