From 4df53df76bc0ddfb83c0270d9d48895a55614296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Fri, 23 Dec 2022 12:16:22 -0300 Subject: [PATCH] [MIG] update tests --- .../tests/test_payments.py | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/l10n_br_account_due_list/tests/test_payments.py b/l10n_br_account_due_list/tests/test_payments.py index 9156d27e12d0..3cadb433bf04 100644 --- a/l10n_br_account_due_list/tests/test_payments.py +++ b/l10n_br_account_due_list/tests/test_payments.py @@ -5,44 +5,26 @@ from odoo.tests import Form, common -class TestPayments(common.SavepointCase): +class TestPayments(common.TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() - cls.account_type = cls.env["account.account.type"].create( - {"name": "Test", "type": "other", "internal_group": "income"} - ) - cls.account = cls.env["account.account"].create( - { - "name": "Test account", - "code": "TEST", - "user_type_id": cls.account_type.id, - "reconcile": True, - } - ) - cls.account_type_receivable = cls.env["account.account.type"].create( - {"name": "Test", "type": "receivable", "internal_group": "income"} - ) cls.account_receivable = cls.env["account.account"].create( { "name": "Test receivable account", "code": "ACCRV", - "user_type_id": cls.account_type_receivable.id, + "account_type": "asset_receivable", "reconcile": True, } ) - cls.account_type_payable = cls.env["account.account.type"].create( - {"name": "Test", "type": "payable", "internal_group": "income"} - ) cls.account_payable = cls.env["account.account"].create( { - "name": "Test receivable account", + "name": "Test payable account", "code": "ACCPAY", - "user_type_id": cls.account_type_payable.id, + "account_type": "asset_payable", "reconcile": True, } ) - cls.partner_1 = cls.env["res.partner"].create( { "name": "Mr. Odoo", @@ -102,7 +84,7 @@ def test_01_receivable(self): "active_id": invoice.id, "active_model": "account.move", } - payment = Form(self.env["account.payment.register"].with_context(ctx)) + payment = Form(self.env["account.payment.register"].with_context(**ctx)) payment_register = payment.save() payment_register.action_create_payments() self.assertEqual(len(invoice.payment_move_line_ids), 1) @@ -141,7 +123,7 @@ def test_02_payable(self): "active_id": invoice.id, "active_model": "account.move", } - payment = Form(self.env["account.payment.register"].with_context(ctx)) + payment = Form(self.env["account.payment.register"].with_context(**ctx)) payment_register = payment.save() payment_register.action_create_payments() self.assertEqual(len(invoice.payment_move_line_ids), 1)