In this commit we introduce a new module ``test_mail_sms`` that holds the tests for sms application, like ``test_mail`` does for mail. Currently all sms tests are inside ``test_mail_full``. After this commit code is moved from ``test_mail_full`` into that module. Full testing module should be used mainly to test integrations with a lot of submodules and for performance tests, not testing details of SMS implementation. We also add ``mass_mailing_sms`` as dependency of ``test_mass_mailing`` so that both mailing types are tested in the same module. It eases maintenance and writing of tests. Mass mailing SMS tests from `test_mail_full`` are therefore moved in ``test_mass_mailing``. This commit also allows some cleaning in classes used in tests, to have classes in ``test_mail_sms`` and ``test_mail_full`` that contain everything necessary to test mail features. Task-2890111 (Test Mail/Mass Mailing: SMS tests reorganization and move) Part-of: odoo/odoo#96223
23 lines
828 B
Python
23 lines
828 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.phone_validation.tools import phone_validation
|
|
from odoo.addons.sms.tests.common import SMSCommon
|
|
from odoo.addons.test_mail.tests.common import TestMailCommon, TestRecipients
|
|
|
|
|
|
class TestSMSCommon(SMSCommon, TestMailCommon):
|
|
""" Main entry point for functional tests. Kept to ease backward
|
|
compatibility and updating common. """
|
|
|
|
|
|
class TestSMSRecipients(TestRecipients):
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super(TestSMSRecipients, cls).setUpClass()
|
|
cls.partner_numbers = [
|
|
phone_validation.phone_format(partner.mobile, partner.country_id.code, partner.country_id.phone_code, force_format='E164')
|
|
for partner in (cls.partner_1 | cls.partner_2)
|
|
]
|