mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
- 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.
21 lines
622 B
Python
21 lines
622 B
Python
# © 2017 Creu Blanca
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
|
|
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)
|
|
with self.assertRaises(ValidationError):
|
|
bank.bic = "TEST"
|