summaryrefslogtreecommitdiff
path: root/addons/mail/tests/test_mail_message.py
AgeCommit message (Collapse)Author
2017-11-29[MOV] (test_)mail: move tests into their dedicated moduleThibault Delavallée
Purpose: avoid having useless tables for test models in a production environment.
2017-11-29[IMP] mail: tests: clean mail message testsThibault Delavallée
Purpose is to lessen noise and make tests less low-level. Including : * move mail_mail model specific tests to its own file; * move feature specific tests to its own file; * add missing loggers to lessen noise;
2017-11-29[MOV] mail: reorganize content of tests, separate tests from models and dataThibault Delavallée
Purpose of this commit is to reorganize the mail tests. Containing * move test models into mail/tests/models/; * move data into mail/tests/data even if it is python code, as it is likely that some additional data will appear soon; * split test_mail_features into test for discuss app and test related to message post and composer, to better identify test target; * split and remove test_portal, those tests are now integrated in the other tests; There is no change in this commit. Only some renaming and file move or split. mergeup: remove / split test portal
2017-11-27[MOV] base: move ir_* models into models/Thibault Delavallée
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-02-21[IMP] mail: make tests less dependent on mail.channel modelThibault Delavallée
Currently almost all mail tests run on mail.channel model. Indeed it is the only model inheriting from mail.thread and mail.alias when having only mail installed. However channel model have several specific features and is not totally a standard mail.thread model. For example notification recipients are computed a bit differently. Since 4f9105a4ef40bccd3b27a6a10cc612636a6499f7 mail module has a test model allowing to perform tests on a very simple mail.thread-like model. This commit make mail tests use this test model instead of mail.channel everywhere it is possible. Channel model should be used only when tests are channel-dependent.
2017-01-17[MERGE] forward port branch saas-11 up to a0aca47feffChristophe Simonis
2017-01-17[MERGE] forward port branch 9.0 up to 16fa61b34f9Christophe Simonis
2017-01-17[MERGE] forward port branch saas-6 up to 7cb977fc3c2Christophe Simonis
2017-01-17[MERGE] forward port branch 8.0 up to 8f1c2bfc918Christophe Simonis
2017-01-17[FIX] mail: force mail.message linked record invalidationChristophe Simonis
2016-12-06[FIX] mail: avoid notifying a message by email when it is already an emailThibault Delavallée
When creating a mail.mail without giving a mail_message_id, a new mail.message is created. It does then through _notify that notifies people of the message creation. This leads to mail being sent two times, one when sending the mail.mail, one when sending the notification. This commits fixes that behavior. When creating directly a mail.mail without giving a mail.message, call to _notify is bypassed. This way either an email is created, either a message that has to be notified is created, but not both.
2016-09-02[FIX] adapt logger namesRaphael Collet
2016-09-01[REF] mail: remove required alias on usersThibault Delavallée
This commit remove required alias on res.users model. It also removes the inheritance of mail.alias.mixin. The field alias_id is kept and allow people to use aliases on users if they want. However there is no default void alias created for each user anymore. Default from of mail.message does not use user alias anymore. Indeed this creates issues with aliases not being correctly configured and can be confusing compared to private channels. Using user aliases is therefore now done manually instead of being a default behavior.
2016-08-10[IMP] various: use odoo for imports instead of openerp and update class namesThibault Delavallée
2016-04-08[IMP] mail: Add counter in starredJigar Patel
2015-08-21[IMP] web: create generic controller '/web/content' and '/web/image'Christophe Matthieu
Replace deprecate controllers like /web/binary/image, /web/binary/saveas... Use ETag for all content with 'unique' option to cache the content if the content is never changed.
2015-08-21[REF] mail: model update for NewChatterThibault Delavallée
Main changes : - mail.notification model is removed. People do not receive notifications anymore. Instead two ways of following documents exist - using a channel; messages will be displayed on the channel itself in a near future commit - following with its partner; messages will all be considered as needaction, using a new m2m table. People should receive less needaction messages by following less records by themselves. There is no more read / unread state anymore. Instead only needaction messages are considered. Todo (Favorites) messages still exist, and are stores on a new m2m table instead of using decorated notifciations. - the main filter for documents is not message_unread anymore, but message_needaction. A lot of views and filters have been updated accordingly. - the vote feature has been removed
2015-07-09[CLEAN] mail: tests: reduce a bit the boilerplate of tests to lessenThibault Delavallée
the testing time.
2015-07-09[RENAME] mail, website_mail, website_mail_group, various: mail.groupThibault Delavallée
model has been renamed to mail.channel to prepare the slack modeling. In future commits the mail.group model will be merged with the channel model from im_chat. The first move is to rename mail.group into mail.channel to have a model that will unite both features.
2015-06-25[MERGE] forward port of branch saas-6 up to 81b5c60Christophe Simonis
2015-06-24[MERGE] forward port of branch 8.0 up to b8bf1e0Christophe Simonis
2015-06-23[IMP] running speed of some tests & new testcase typeXavier Morel
Some tests (e.g. mail) have expensive and significant DB setup for a number of small and cheap tests. Using a TransactionCase, the DB setup far dominates the tests themselves, by up to 10x (mail unit tests take ~130s on my machine, the tests themselves take ~15s). The SavepointCase introduced here is an hybrid of SingleTransactionCase and TransactionCase: it uses a single transaction for all tests in a class, but each test case is isolated by a rollbacked savepoint. This allows a common DB setup (via setUpClass) while keeping independent tests. TransactionCase should remain the primary test case superclass, but SavepointCase can be a fair optimisation when setup costs far dominate.
2015-05-19[IMP][FIX] mail: tests: updated mute loggers (moved files) + added loggers ↵Thibault Delavallée
were necessary.
2015-04-27[MIGR] mail: migration to the new APIThibault Delavallée
2015-03-24[REF] mail: migrated tests to the new API and refactored them.Jignesh Rathod
Tests have been migrated to the new api to prepare the migration of the mail module itself. Moreover tests have been cleaned: redundant tests and unnecessary tests have been removed. As the base test class in mail is used in other addons, other addons have been updated : - portal - project - portal_project - website_project_issue - sale - purchase Future commits will come with somes fixes for issues detected when cleaning the tests.
2015-01-16[IMP] Cleanup and refactoring of exception handlingGoffin Simon
Unify and refactor exception handling in framework and addons. The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes: - `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration. - `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights. - `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request. - `MissingError`: raised when an operation is attempted on a record that does not exist. - `ValidationError`: raised when an operation violates a SQL or Python constraint. - All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback. All exceptions take a single message argument. The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions. A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages. This commit introduces a more consistent policy for logging errors and warnings: - All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations. - All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention. - All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.
2014-08-13[MERGE] Forward-port of saas-5 up to 20cc18dOlivier Dony
2014-08-12[FIX] mail: forward-port of rev 245bb4ebdfeccb05134b3ff943c9fd0fb01173c2Denis Ledoux
2014-08-04[REF] mail: same_thread field changed into no_auto_thread, its contrary, to ↵Thibault Delavallée
avoid migration issues (adding a 'always False' column is easier than an 'always True').
2014-07-06[MERGE] new v8 api by rcoRaphael Collet
A squashed merge is required as the conversion of the apiculture branch from bzr to git was not correctly done. The git history contains irrelevant blobs and commits. This branch brings a lot of changes and fixes, too many to list exhaustively. - New orm api, objects are now used instead of ids - Environements to encapsulates cr uid context while maintaining backward compatibility - Field compute attribute is a new object oriented way to define function fields - Shared browse record cache - New onchange protocol - Optional copy flag on fields - Documentation update - Dead code cleanup - Lots of fixes
2014-06-23[REF] mail, crm, hr_recruitment, project, project_issue: simplified reply-to ↵Thibault Delavallée
of notification emails (now displaying 'YourCompany -docname- <email>' instead of 'Followers of ...'; added same_thread directly on the mail.message model to ease the reply_to and message-id computation; factorized a bit the reply-to generation for a batch of records; udpated tests accordingly.
2013-12-06[FIX] [TESTS] mail, portal: fixed tests, because the error raised by the ↵Thibault Delavallée
OROM has changed in some cases. bzr revid: tde@openerp.com-20131206121432-mz2jpj535tmcmftl
2013-08-27[IMP] mail_mail, mail_message: various improvements to try to improve ↵Thibault Delavallée
message creation time Replaced some read by browse Moved get_reply_to from mail_mail to mail_message Hint: specifying email_from, reply_to help to enhance computation time [REF] mail: cleaned some tests, renamed a file, moved mail_group tests into a dedicated file bzr revid: tde@openerp.com-20130827133058-ko0g0ib0f0jihmdk
2013-02-21[CLEAN] mail: stop doing ugly things with partner_ids values before passing ↵Thibault Delavallée
values to mail_message.create(). bzr revid: tde@openerp.com-20130221095906-5rbwnc83mjvpkyhh
2013-01-09[IMP] Partners do not follow themselves by default now.Thibault Delavallée
bzr revid: tde@openerp.com-20130109104513-3vlyw4knqp4d6to2
2012-12-12[IMP] mail_message: added the right to reply to a message wes received even ↵Thibault Delavallée
if we cannot see the related document. bzr revid: tde@openerp.com-20121212160634-umbiq2erwijm2d20
2012-12-12[IMP] mail: updated lambda user, now having less permissive access rights on ↵Thibault Delavallée
mail_mail. bzr revid: tde@openerp.com-20121212114905-5kgnoix0puxo30ns
2012-12-12[IMP] mail: updated and improved tests.Thibault Delavallée
bzr revid: tde@openerp.com-20121212104220-d6l7wjghv9oo9dy1
2012-12-11[MERGE] Sync with trunk. Cleaned a bit things lastly added in trunk/mail/tests.Thibault Delavallée
bzr revid: tde@openerp.com-20121211161458-d7wv4lnkvs9s7srj
2012-12-11[MERGE] Merged branch holding fix of access rights when deleting a document, ↵Thibault Delavallée
and the removal of inherits between mail.group and ir.ui.menu. bzr revid: tde@openerp.com-20121211145536-a02i45isg30l9940
2012-12-11[REF] [TESTS] mail, portal: refactored a bit the various mail and invite ↵Thibault Delavallée
tests: moved some tests into dedicated files, added some new tests, removed duplicates. bzr revid: tde@openerp.com-20121211144650-kpy7noe082e3xvoo