From 8e84b8a351eb2ed489034414753c9538d8ad77ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 14 Oct 2024 06:22:42 +0000 Subject: [PATCH] [REM] l10n_br_account_nfe: drop _register_hook --- .../tests/test_nfce_contingency.py | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/l10n_br_account_nfe/tests/test_nfce_contingency.py b/l10n_br_account_nfe/tests/test_nfce_contingency.py index 7d074f4a4805..1fd47fe88645 100644 --- a/l10n_br_account_nfe/tests/test_nfce_contingency.py +++ b/l10n_br_account_nfe/tests/test_nfce_contingency.py @@ -5,65 +5,60 @@ class TestAccountNFCeContingency(TransactionCase): - @classmethod - def setUpClass(cls): - super().setUpClass() - # this hook is required to test l10n_br_account_nfe alone: - cls.env["spec.mixin.nfe"]._register_hook() - cls.document_id = cls.env.ref("l10n_br_nfe.demo_nfce_same_state") - cls.prepare_account_move_nfce() + def setUp(self): + super().setUp() + self.document_id = self.env.ref("l10n_br_nfe.demo_nfce_same_state") + self.prepare_account_move_nfce() - @classmethod - def prepare_account_move_nfce(cls): - receivable_account_id = cls.env["account.account"].create( + def prepare_account_move_nfce(self): + receivable_account_id = self.env["account.account"].create( { "name": "TEST ACCOUNT", - "code": "01.1.1.2.2", + "code": "1.1.1.2.2", "reconcile": 1, - "company_id": cls.env.ref("base.main_company").id, - "account_type": "asset_receivable", + "company_id": self.env.ref("base.main_company").id, + "account_type": "asset_receivable",_receivable").id, } ) - payable_account_id = cls.env["account.account"].create( + payable_account_id = self.env["account.account"].create( { "name": "TEST ACCOUNT 2", - "code": "01.1.1.2.3", + "code": "1.1.1.2.3", "reconcile": 1, - "company_id": cls.env.ref("base.main_company").id, + "company_id": self.env.ref("base.main_company").id, "account_type": "liability_payable", - } ) - payment_method = cls.env.ref("account.account_payment_method_manual_in").id - journal_id = cls.env["account.journal"].create( + payment_method = self.env.ref("account.account_payment_method_manual_in").id + journal_id = self.env["account.journal"].create( { "name": "JOURNAL TEST", "code": "TEST", "type": "bank", - "company_id": cls.env.ref("base.main_company").id, + "company_id": self.env.ref("base.main_company").id, } ) - payment_mode = cls.env["account.payment.mode"].create( + payment_mode = self.env["account.payment.mode"].create( { "name": "PAYMENT MODE TEST", - "company_id": cls.env.ref("base.main_company").id, + "company_id": self.env.ref("base.main_company").id, "payment_method_id": payment_method, "fiscal_payment_mode": "15", "bank_account_link": "fixed", "fixed_journal_id": journal_id.id, } ) - cls.document_move_id = cls.env["account.move"].create( + self.document_move_id = self.env["account.move"].create( { "name": "MOVE TEST", "payment_mode_id": payment_mode.id, - "company_id": cls.env.ref("base.main_company").id, + "company_id": self.env.ref("base.main_company").id, "line_ids": [ (0, 0, {"account_id": receivable_account_id.id, "credit": 10}), (0, 0, {"account_id": payable_account_id.id, "debit": 10}), ], } ) - cls.document_move_id.fiscal_document_id = cls.document_id.id + self.document_move_id.fiscal_document_id = self.document_id.id def test_nfce_contingencia(self): self.document_id._update_nfce_for_offline_contingency()