mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_banking_mandate: test performance improvement
- Include context keys for avoiding mail operations overhead.
This commit is contained in:
committed by
Sébastien Alix
parent
260d47b47d
commit
dce0c0e532
@@ -8,6 +8,7 @@ from odoo.exceptions import UserError
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
from odoo.addons.account.models.account_payment_method import AccountPaymentMethod
|
||||
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
|
||||
|
||||
|
||||
class TestInvoiceMandate(TransactionCase):
|
||||
@@ -203,6 +204,7 @@ class TestInvoiceMandate(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
|
||||
cls.company = cls.env.ref("base.main_company")
|
||||
|
||||
cls.partner = cls._create_res_partner("Peter with ACME Bank")
|
||||
|
||||
@@ -7,13 +7,16 @@ from odoo import fields
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
|
||||
|
||||
|
||||
class TestMandate(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.company = cls.env.company
|
||||
cls.company_2 = cls.env["res.company"].create({"name": "company 2"})
|
||||
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
|
||||
cls.company = cls.env.ref("base.main_company")
|
||||
cls.company_2 = cls.env["res.company"].create({"name": "Company 2"})
|
||||
cls.company_2.partner_id.company_id = cls.company_2.id
|
||||
cls.bank_account = cls.env.ref("account_payment_mode.res_partner_12_iban")
|
||||
cls.bank_account.partner_id.company_id = cls.company.id
|
||||
|
||||
@@ -18,8 +18,9 @@ class TestPaymentMode(TransactionCase):
|
||||
AccountPaymentMethod._get_payment_method_information
|
||||
)
|
||||
|
||||
def _get_payment_method_information(self):
|
||||
res = Method_get_payment_method_information(self)
|
||||
@classmethod
|
||||
def _get_payment_method_information(cls):
|
||||
res = Method_get_payment_method_information(cls)
|
||||
res["IN"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
|
||||
res["IN2"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
|
||||
res["electronic_out"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
|
||||
|
||||
Reference in New Issue
Block a user