Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] {test_}mail: move helper tools and classes from test_mail to mail to ease reuse #38070

Open
wants to merge 22 commits into
base: master
from

Conversation

@tde-banana-odoo
Copy link
Contributor

tde-banana-odoo commented Oct 7, 2019

No description provided.

@robodoo robodoo added the seen 🙂 label Oct 7, 2019
@C3POdoo C3POdoo added the RD label Oct 7, 2019
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-mail-tests-tools-tde branch 4 times, most recently from 69f8fd5 to 994f4d2 Oct 8, 2019
failed.sudo().write({
'notification_status': 'exception',
'failure_type': failure_type,
'failure_reason': failure_reason,
})
messages = notifications.mapped('mail_message_id').filtered(lambda m: m.is_thread_message())
print('Notifying in post process sent message for %s (pids: %s)' % (failed.ids, failed.res_partner_id))

This comment has been minimized.

Copy link
@Xavier-Do

Xavier-Do Oct 10, 2019

Contributor

LGTM for notification fix commit but you forgot a print

@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-mail-tests-tools-tde branch 4 times, most recently from 5c9d92d to eefc033 Oct 11, 2019
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-mail-tests-tools-tde branch from eefc033 to ca879b3 Oct 25, 2019
@KangOl KangOl force-pushed the odoo:master branch from 86c80d3 to ab6d0c3 Nov 6, 2019
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-mail-tests-tools-tde branch 2 times, most recently from 5e0efc8 to 543406e Nov 8, 2019
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

Have class, mocks, tools and asserts available in mail so that all modules
below from mail can use them.

Including

  * mock mail gateway in a clean way: mock server connection, email building
    and sending;
  * allow to simulate errors while sending emails to test corner cases;
  * mock mail application to check record creation (message, notifications,
    mails, ...);
  * mock bus notification;
  * provide clearer assert methods;

LINKS

Task ID 2068986
PURPOSE

Use newly-introduced tools and asserts available in mail.

SPECIFICATIONS

In this commit we add ``TestMailCommon`` that will be the class for all test_*
modules linked to mail features. It is build upon tools made available in
mail tests (mocks, tools, asserts) and give the functional basis for mail
tests.

This commit also introduces ``TestMailMultiCompanyCommon`` that is a small
multi company testing class build on ``TestMailCommon``.

``TestRecipients`` class is kept as it creates some testing partners, used
notably for notifications and recipients.

Future commits will gradually make tests use this class instead of the
``BaseFunctionalTest`` that will be set to retirement.

LINKS

Task ID 2068986
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-mail-tests-tools-tde branch from 54b73b9 to 921f628 Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.