diff options
| author | Thibault Delavallée <tde@odoo.com> | 2020-04-29 11:38:20 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-05-26 10:35:58 +0000 |
| commit | 4a2ac044f8bd4a5a1f96f0e45c008473dc15eec3 (patch) | |
| tree | 26d9b7406dadcbe299941f371803f363e6426946 /addons/mass_mailing_sms/tests | |
| parent | a874dfa08abd5b3c54e29c0257dfa23118b910da (diff) | |
[IMP] (test_)(mass_)mail(_full): rename and reorganize mail related test classes
Modules holding tests and helpers
* link_tracker: mainly mock, asserts and tools for link tracker tests
(MockLinkTracker);
* mail: mainly gateway mock and base for mail tests
* MockEmail -> mocks for mail gateway;
* MailCase -> tools and asserts for mail tests;
* MailCommon -> base for mail functional tests);
* sms: mainly SMS gateway mock and base for sms tests
* MockSMS -> mocks for SMS gateway;
* SMS Case -> tools and asserts for mail / SMS tests;
* SMSCommon -> update of MailCommon with SMS capabilities);
* mass_mailing: mainly asserts and tools for mass mailing tests
* MassMailCase -> update of MailCase for mass mailing tools and asserts;
* MassMailCommon -> update of MailCommon with mass mailing);
* mass_mailing_sms: mainly asserts and tools for mass SMS tests
* MockMassSMS -> update of MockSMS for mass SMS tools and asserts;
* MassSMSCommon -> update of MassMailCommon with SMS capabilities);
Modules for tests
* test_mail: module for mail app tests (TestMailCommon);
* test_mass_mailing: module for mass mailing app tests (TestMassMailCommon);
* test_mail_full: tests integrating all discuss features, currently mainly
mail and SMS (TestMailFullCommon);
Enterprise: update test_mail_enterprise and test_marketing_automation
Task ID 2247037
Community PR odoo/odoo#50384
Enterprise PR odoo/enterprise#10266
Upgrade PR odoo/upgrade#1122
Diffstat (limited to 'addons/mass_mailing_sms/tests')
| -rw-r--r-- | addons/mass_mailing_sms/tests/common.py | 18 | ||||
| -rw-r--r-- | addons/mass_mailing_sms/tests/test_mailing_internals.py | 4 |
2 files changed, 12 insertions, 10 deletions
diff --git a/addons/mass_mailing_sms/tests/common.py b/addons/mass_mailing_sms/tests/common.py index bffc117ac22..6049fc610b7 100644 --- a/addons/mass_mailing_sms/tests/common.py +++ b/addons/mass_mailing_sms/tests/common.py @@ -1,16 +1,11 @@ # -*- coding: utf-8 -*- -from contextlib import contextmanager -from unittest.mock import patch - -from odoo import exceptions, tools +from odoo.addons.mass_mailing.tests.common import MassMailCommon from odoo.addons.phone_validation.tools import phone_validation -from odoo.addons.sms.tests import common as sms_common -from odoo.tests import common -from odoo.addons.sms.models.sms_api import SmsApi +from odoo.addons.sms.tests.common import SMSCase, SMSCommon -class MockSMS(sms_common.MockSMS): +class MassSMSCase(SMSCase): def assertSMSOutgoingStatistics(self, partners, numbers, records, mailing): found_sms = self.env['sms.sms'].sudo().search([ @@ -71,3 +66,10 @@ class MockSMS(sms_common.MockSMS): self.assertSMSCanceled(partner, number, recipient_info.get('failure_type', False), content) else: raise NotImplementedError() + + +class MassSMSCommon(MassMailCommon, SMSCommon, MassSMSCase): + + @classmethod + def setUpClass(cls): + super(MassSMSCommon, cls).setUpClass() diff --git a/addons/mass_mailing_sms/tests/test_mailing_internals.py b/addons/mass_mailing_sms/tests/test_mailing_internals.py index a9c4c2f218a..46f1e508665 100644 --- a/addons/mass_mailing_sms/tests/test_mailing_internals.py +++ b/addons/mass_mailing_sms/tests/test_mailing_internals.py @@ -3,11 +3,11 @@ from ast import literal_eval -from odoo.addons.mass_mailing.tests.common import TestMassMailCommon +from odoo.addons.mass_mailing_sms.tests.common import MassSMSCommon from odoo.tests.common import users -class TestMassMailValues(TestMassMailCommon): +class TestMassMailValues(MassSMSCommon): @classmethod def setUpClass(cls): |
