summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_message_composer.py
AgeCommit message (Collapse)Author
2021-04-08[MOV] mail, test_mail: merge and improve composer testsThibault Delavallée
This commits is a bit a followup of odoo/odoo#62061 where new composer tests were added. This commit finalize this work by merging all composer related tests within the same file. It also backports some of tooling update done in odoo/odoo#64459 or odoo/odoo#63677 in order to have coherent naming through 14+ versions. Some additional or deeper tests are added. Notably it now more cleanly uses asserts for created mail.mail and sent emails. Task ID-2500615 COM PR odoo/odoo#68874
2020-11-26[IMP] test_mail: add new mail composer tests for its internalsThibault Delavallée
Purpose is to have some low level tests for composer itself allowing to ensure its behavior. We add tests notably about default values computation in mass mailing mode as well as template_id change and values synchronization in composer model. In a near future composer will probably be improved (use computed fields, rewrite part of its logic to improve performances). Having tests done before those tasks ensure we notice every change that might happen. Task ID-2390314 PR odoo/odoo#62061
2020-05-26[IMP] (test_)(mass_)mail(_full): rename and reorganize mail related test classesThibault Delavallée
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
2020-01-23Revert "[IMP] test_mail(_full): run tests at post_install"Xavier-Do
This reverts commit 976e560a877bcaf9e769b6005d33bd49833eceb9. Even if it didn't looked like a bad idea, this need some more thinking. This new version of query count creates random failure of runbot builds. closes odoo/odoo#43820 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-22[IMP] test_mail(_full): run tests at post_installSébastien Theys
- take advantage of runbot multi-build capabilities - get similar result when running them locally during dev - better detect when other modules add extra queries Query counts are split in the base value (testing with just test_mail installed) + the extra modules overhead. Part of task-2178641 closes odoo/odoo#43666 Pr: #43666 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-11-29[FIX] mail: restrict access to mail.mail modelThibault Delavallée
From now on mail.mail is considered as a technical model. Indeed people should not really manually craft mails by hand. Instead various functional flows should either send mails, either craft mails based on some user input. We therefore make mail restricted to admin users. Flows creating mail.mail are updated to use sudo, and ensure it was done in a context that makes sense to delegate this power to the user. Task ID 1853147 PR #32243
2019-11-20[REF] test_mail: update test message composer / message track / activity to ↵Thibault Delavallée
new common PURPOSE Currently tools and asserts for mail tests are located inside test_mail module. It makes difficult to re-use them in apps tests or force them to write custom quick and dirty tools and asserts. SPECIFICATIONS Update tests to new tools / asserts / helpers / classes defined in mail and test_mail. Notably * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon`` pimped one; * ``assertNotifications`` is replaced by ``assertSinglePostNotifications`` (shortcut for a simple message_post) or ``assertPostNotifications`` (complete asserts involving several messages and notifications); * correctly invoke ``mock_mail_gateway`` when mocking email sending; * replace manual check of sent emails or ``assertEmails`` by ``assertSentEmails``; * remove custom mocks / checks and replace them by now standard mocks and assertions (if any); In this commit we update: test_message_composer, test_message_track and test_mail_activity. LINKS Task ID 2068986 PR #38070
2019-09-06[MOV] test_mail: move composer and post tests from template testsThibault Delavallée
PURPOSE In order to rewrite some tests, remove low-level tests and add coverage first step is to reorganize a bit test_mail content. Several tests cases are spread among several files and finding back some feature coverage tests is not easy. SPECIFICATIONS Reorganize tests, notably * put composer with template tests in with composer tests; * put post with template tests with post tests; * put tracking multi company test with tracking tests; LINKS Task 1958697
2019-09-06[MOV] test_mail: split post and composer testsThibault Delavallée
PURPOSE In order to rewrite some tests, remove low-level tests and add coverage first step is to reorganize a bit test_mail content. Several tests cases are spread among several files and finding back some feature coverage tests is not easy. SPECIFICATIONS Reorganize tests, notably * put message_post related test in test_message_post; * have only composer related test in test_message_compose(r); * put alias tests in test_mail_gateway; * move some discuss tests to post tests as they are linked to notification details, not really Discuss features. LINKS Task 1958697