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/test_mail_full/tests/common.py | |
| 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/test_mail_full/tests/common.py')
| -rw-r--r-- | addons/test_mail_full/tests/common.py | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/addons/test_mail_full/tests/common.py b/addons/test_mail_full/tests/common.py index 6fac92a5aab..1f75394df99 100644 --- a/addons/test_mail_full/tests/common.py +++ b/addons/test_mail_full/tests/common.py @@ -1,39 +1,12 @@ # -*- coding: utf-8 -*- from odoo.addons.phone_validation.tools import phone_validation -from odoo.addons.mass_mailing_sms.tests import common as mass_mailing_sms_common -from odoo.addons.test_mail.tests import common as test_mail_common -from odoo.addons.test_mass_mailing.tests import common as test_mass_mailing_common +from odoo.addons.mass_mailing_sms.tests.common import MassSMSCommon +from odoo.addons.test_mail.tests.common import TestRecipients +from odoo.addons.test_mass_mailing.tests.common import TestMassMailCommon -class TestSMSCommon(test_mass_mailing_common.TestMassMailCommon, mass_mailing_sms_common.MockSMS): - - @classmethod - def setUpClass(cls): - super(TestSMSCommon, cls).setUpClass() - cls.user_employee.write({'login': 'employee'}) - - # update country to belgium in order to test sanitization of numbers - cls.user_employee.company_id.write({'country_id': cls.env.ref('base.be').id}) - - # some numbers for testing - cls.random_numbers_str = '+32456998877, 0456665544' - cls.random_numbers = cls.random_numbers_str.split(', ') - cls.random_numbers_san = [phone_validation.phone_format(number, 'BE', '32', force_format='E164') for number in cls.random_numbers] - cls.test_numbers = ['+32456010203', '0456 04 05 06', '0032456070809'] - cls.test_numbers_san = [phone_validation.phone_format(number, 'BE', '32', force_format='E164') for number in cls.test_numbers] - - # some numbers for mass testing - cls.mass_numbers = ['04561%s2%s3%s' % (x, x, x) for x in range(0, 10)] - cls.mass_numbers_san = [phone_validation.phone_format(number, 'BE', '32', force_format='E164') for number in cls.mass_numbers] - - @classmethod - def _create_sms_template(cls, model, body=False): - return cls.env['sms.template'].create({ - 'name': 'Test Template', - 'model_id': cls.env['ir.model']._get(model).id, - 'body': body if body else 'Dear ${object.display_name} this is an SMS.' - }) +class TestMailFullCommon(TestMassMailCommon, MassSMSCommon): @classmethod def _create_records_for_batch(cls, model, count): @@ -55,7 +28,7 @@ class TestSMSCommon(test_mass_mailing_common.TestMassMailCommon, mass_mailing_sm cls.partners = partners -class TestRecipients(test_mail_common.TestRecipients): +class TestRecipients(TestRecipients): @classmethod def setUpClass(cls): |
