mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_payment_order: test performance improvement
- Create setUpClass method - Switch to setUpClass (if needed) for avoiding repeat the same setup for each test. - Include context keys for avoiding mail operations overhead.
This commit is contained in:
committed by
Sébastien Alix
parent
fb443140a8
commit
7d9d5400fc
@@ -4,8 +4,15 @@
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
|
||||
|
||||
|
||||
class TestBank(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
|
||||
|
||||
def test_bank(self):
|
||||
bank = self.env["res.bank"].search([], limit=1)
|
||||
self.assertTrue(bank)
|
||||
|
||||
@@ -18,7 +18,6 @@ class TestPaymentMode(TransactionCase):
|
||||
AccountPaymentMethod._get_payment_method_information
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _get_payment_method_information(cls):
|
||||
res = Method_get_payment_method_information(cls)
|
||||
res["IN"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
|
||||
|
||||
Reference in New Issue
Block a user