Commit Graph
9 Commits
Author SHA1 Message Date
bit-odoo e0df791441 [FIX] (test_)mail: update status of failure notification instantly
Before this commit:

Currently, failure notifications are sent to the author of the message that the
failure is concerning.

However, if another user than the author is resolving the failure, he is not
receiving any notification without refresh the page, so it appears as if nothing
happened even though the failure was indeed resolved
(either message resent, or failure ignored).

After this commit:

When another user than the author update the status of the failure notification
(message resent or failure ignored). the statues of the failure notification
update instantly, no refresh needed to show the updated status.

Task-2178257

closes odoo/odoo#68860

Related: odoo/enterprise#18748
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-04 09:17:33 +00:00
Thibault Delavallée 1e53dd9adb [FIX] test_mail: make tests reproducible and independent from bus state
Some tests are currently dependent on bus state when computing number of
notifications sent. For example install Crm then test_mail_full. Some
tests crash as too much notifications are found in the bus.

We therefore clean remaining bus notifications before running tests to
ensure we check notifications during test itself. This make tests more
easy to reproduce.

Task ID-2390314
PR #62061

X-original-commit: 92ff1379b0492765fd0ba9863a9ce13fba7eeb4a
2020-11-26 10:43:07 +00:00
Xavier-Do 8970127c03 Revert "[IMP] test_mail(_full): run tests at post_install"
This reverts commit 976e560a87.

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-23 09:19:12 +00:00
Sébastien Theys 976e560a87 [IMP] test_mail(_full): run tests at post_install
- 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>
2020-01-22 13:36:22 +00:00
Thibault Delavallée e2b33f460d [REF] mail, various: rename subtype parameter of message_post to subtype_xmlid
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Thibault Delavallée 2ef5fc80ab [REF] test_mail: update test message management to 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);
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test message management

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:59 +00:00
Julien Castiaux 4f03a5f136 [FIX] *: remove old deprecated modules/functions
PEP-594 is deprecating a bunch of modules. As part of the cleanup, we
are also dealing with long deprecated modules, functions and aliases.

* `assert_` -> `assertTrue`
* `assertEquals` -> `assertEqual`
* `assertNotEquals` -> `assertNotEqual`
* `assertAlmostEquals` -> `assertAlmostEqual`
* `assertRaisesRegexp` -> `assertRaisesRegex`
* `assertRegexpMatches` -> `assertRegex`
* `base64.encodestring` -> `base64.encodebytes`
* `base64.decodestring` -> `base64.decodebytes`
* `inspect.getargspec` -> `inspect.signature`
* `inspect.formatargspec` -> `inspect.signature`
* `logging.warn` -> `logging.warning`

closes odoo/odoo#36863

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-17 11:36:42 +00:00
Christophe Simonis 6c948c36bb [MERGE] forward port branch saas-12.5 up to 197474e5b9 2019-09-13 18:07:59 +02:00
Thibault Delavallée 803d87c46d [MOV] test_mail: rename some test files
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

  * put channel moderation tests in test_mail_channel;
  * rename resend to message management;
  * rename multi company test to redirect tests:

LINKS

Task 1958697
2019-09-06 13:37:56 +00:00