mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] report_xml: test performance improvement
- Create setUpClass method - Include context keys for avoiding mail operations overhead.
This commit is contained in:
@@ -7,6 +7,20 @@ from odoo.tests import common
|
||||
|
||||
|
||||
class TestXmlReport(common.TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
# Remove this variable in v16 and put instead:
|
||||
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
|
||||
DISABLED_MAIL_CONTEXT = {
|
||||
"tracking_disable": True,
|
||||
"mail_create_nolog": True,
|
||||
"mail_create_nosubscribe": True,
|
||||
"mail_notrack": True,
|
||||
"no_reset_password": True,
|
||||
}
|
||||
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
|
||||
|
||||
def test_xml(self):
|
||||
report_object = self.env["ir.actions.report"]
|
||||
report_name = "report_xml.demo_report_xml_view"
|
||||
|
||||
Reference in New Issue
Block a user