Files
odoo_source/addons/test_crm_full/tests/common.py
T
Thibault Delavallée 16561f042a [ADD] test_crm_full: test module for crm
Purpose of this commit is to add a base module holding tests for the whole
crm ecosystem. It notably holds currently performance tests, allowing to
track future improvements and changes.

Task-2720144 (Crm performance tests)
Also linked to Task-2703285 (Event performance improvements - event_crm)

closes odoo/odoo#81717

Related: odoo/enterprise#23046
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-21 20:20:50 +00:00

44 lines
1.5 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from odoo.addons.crm.tests.common import TestCrmCommon
from odoo.addons.crm_iap_mine.tests.common import MockIAPReveal # MockIAPEnrich
from odoo.addons.website.tests.test_website_visitor import MockVisitor
class TestCrmFullCommon(TestCrmCommon, MockIAPReveal, MockVisitor):
@classmethod
def setUpClass(cls):
super(TestCrmFullCommon, cls).setUpClass()
cls._init_mail_gateway()
cls._activate_multi_company()
# Context data: dates
# ------------------------------------------------------------
# Mock dates to have reproducible computed fields based on time
cls.reference_now = datetime(2022, 1, 1, 10, 0, 0)
cls.reference_today = datetime(2022, 1, 1)
# Customers
# ------------------------------------------------------------
country_be = cls.env.ref('base.be')
cls.env['res.lang']._activate_lang('fr_BE')
cls.partners = cls.env['res.partner'].create([
{'country_id': country_be.id,
'email': 'partner.email.%02d@test.example.com' % idx,
'function': 'Noisy Customer',
'lang': 'fr_BE',
'mobile': '04569999%02d' % idx,
'name': 'PartnerCustomer',
'phone': '04560000%02d' % idx,
'street': 'Super Street, %092d' % idx,
'zip': '1400',
} for idx in range(0, 10)
])