Commit Graph
22 Commits
Author SHA1 Message Date
Raphael Collet a38dc1ccb9 [FIX] test_mail: adapt query counts
closes odoo/odoo#32905

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-06 09:44:10 +00:00
Christophe Simonis 8f1daaf937 [FIX] {,test_}mass_mailing: set mail.mass_mailing subject
Field is required.
2019-03-11 15:44:32 +01:00
Christophe Simonis 4400cce820 [MERGE] forward port branch saas-12.1 up to 4524ad06a8 2019-02-04 13:27:22 +01:00
Christophe Simonis f927c68ddb [MERGE] forward port branch 12.0 up to cb8fefa899 2019-01-31 16:59:58 +01:00
Christophe Simonis 40b2bf96bd [FIX] test_mass_mailing: bump query counts
Now that urls are shortened by email (and not globally)[1], more queries
are executed.

Oversight of previous forward-port

[1] See #29083
2019-01-29 19:24:03 +01:00
David Beguin 692f0062fb [IMP] mail, mass_mailing, crm : stringify _primary_email
_primary_email was an array to be able to use it directly in the
depends. Typically a 'depends' with a computed value (lambda) needs
an array. Otherwise, it will only take the first character of the
field name string.

By setting _primary_email as a string, the lambda should always get
an array. But it simplifies a lot the usage of the _primary_email.
also, having an array was confusing as we could think that more than
one field can be considered as the primary email. This is not the
goal hare. So having the _primary_email as a single string is more
'self describing'. Only one field should be the _primary_email.
2018-11-20 11:37:05 +00:00
David Beguin fc2a8d63ee [IMP] mail, mass_mailing, mass_mailing_crm : Use normalized email in unsubscribe link
Use the email_normalized from mail.address.mixin if available to get always
a normalized email address in the unsubscribe link. That allows to simplify
the search on email address in the controllers -> Check blacklist,
send feedback, etc..

Task ID 1896677
2018-11-20 11:37:05 +00:00
David Beguin 0fe50a01d2 [IMP] mail : apply mail.address.mixin on blacklist
Apply the mail.address.mixin on blacklist mixin. So that every model
inheriting the blacklist.mixin will also inherit the address.mixin.

That simplify also the comparaison to - and the searches on - the
blacklist.

Task ID 1896677
2018-11-20 11:37:05 +00:00
Thibault Delavallée b670911a92 [REF] link_tracker, mass_mailing: simplify add_click method and add tests
In this commit we rewrite a bit add_click in order to remove the inlined sudo
and ease inheritance and parameter management inside the method.

Access through controllers is sudo-ed as the main API method is now done
with current user access rights.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:26 +00:00
David Beguin bf441b984f [IMP] mass_mailing : add blacklist and opt_out demo data
In order to understand more easily the impact of an opt out
or a blacklisted contact on the interface, blacklist and
opt-out demo data are added.

Tests updated to only test mails on contacts created inside
the test environement and not with demo data.

Task ID 1892998
Closes PR #27674
2018-11-09 08:46:35 +00:00
Thibault Delavallée 82329eab64 [REF] test_mass_mailing: make performance test class child of TransactionCase
It eases manipulation and lessen overhead. Performance tests should be self
contained as much as possible.

Commit linked to task ID 1902307.
2018-10-23 08:44:08 +00:00
Christophe Simonis b81c2bce84 [MERGE] forward port branch saas-11.4 up to 3c108977c1 2018-10-22 16:59:51 +02:00
Thibault Delavallée b4b2a04291 [IMP] test_mass_mailing: add performance tests
Purpose is to have some basis performance counters when sending a mailing
on 100 records, with and without blacklist involved. It will serves as
reference when working on mass mailing performance improvements in future
tasks.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée dcec209805 [FIX] mass_mailing: fix tracking link creation in mass mailing
When using only mass mailing two issues arise when trying to send mass
mailings containing links

 * a link.tracker is created for each link to shorten; however rights are
   given currently only in website_links for website designers and not to
   marketing users that use mass mailing. This commit adds the rights for
   link.tracker model to those people;
 * a link.tracker.code is created to hold the shortened versions of the
   links. As it is a technical model it is now done as superuser as rights
   on link.tracked model has already been granted and adding rights on such
   a technical model is not necessary;

A test is added that checks what is done with links when sending mass
mailings. It helped spotting the hereabove issue.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée 7edcbfec38 [REF] test_mass_mailing: use odoo test helper method to create test users
Purpose of this commit is to use the newly introduced helper to create
test users in a quick way and reduce code duplication.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée 96fbc1a957 [MOV] (test_)mass_mailing: move not mass-mailing models specific tests
Purpose of this commit is to move tests not completely specific to some
mass mailing models to test_mass_mailing. Purpose is to allow to write
more in-depth tests based on existing ones by using test models instead
of some standard odoo ones.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée 78f14a0aef [MOV][REF] test_mass_mailing: move and clean blacklist access rights tests
Purpose is to continue the move of some tests from mass_mailing to
test_mass_mailing done at https://github.com/odoo/odoo/commit/0c37eb272fba1063444f0ec91db1fe543c1beebf. Some additional cases are added in the
parsing of blacklist entries to test some corner cases.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée 397434a75d [REF] test_mass_mailing: use odoo test helper method to create test users
Purpose of this commit is to use the newly introduced helper to create
test users in a quick way and reduce code duplication.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée a7b3d1697c [REF] test_mail: use odoo test helper method to create test users
Purpose of this commit is to use the newly introduced helper to create
test users in a quick way and reduce code duplication. A mail specific
helper tool function is defined based on the standard one defined in test
allowing to pass a custom context. It bypasses mailing features in order
to speedup the creation.

This commit is linked to task ID 1889703 and PR #27526.
2018-10-18 13:57:02 +00:00
Thibault Delavallée 0c37eb272f [IMP] test_mass_mailing: add blacklist mixin tests
Purpose of this commit is to add some tests linked to the blacklist mixin
itself, notably the computed fields and its search method.

This commit is related to task ID 33224 (original blacklist implementation
done for v12) and its PR #25966 as well as task ID 1889703 (tests and fixes)
and its PR #27330. Done with collaboration of @dbeguin.
2018-10-02 16:52:18 +02:00
Thibault Delavallée 3922832967 [IMP] test_mass_mailing: add blacklist tests
Purpose of this commit is to enforce blacklist use and base mechanisms. This
commit may break on runbot as fixes will come after having introduced tests.
It notably add tests for a8ce59ce36.

This commit is related to task ID 33224 (original blacklist implementation
done for v12) and its PR #25966 as well as task ID 1889703 (tests and fixes)
and its PR #27330. Done with collaboration of @dbeguin.
2018-10-02 16:33:16 +02:00
Thibault Delavallée fca1654dc5 [ADD] test_mass_mailing: add module to hold feature and performance tests for mass mailing
Purpose of this commit is to add the skeleton of a module holding models and
tests for mass mailing. It is build on top of test_mail in order to use
data, models and parameters already defined in it. Moreover having a
separate module allow to define test models that will not bloat production
databases.

It will soon hold unit tests for blacklist mechanism. Future commits will
gradually move tests from mass mailing module and improve them.

This commit is related to task ID 33224 (original blacklist implementation
done for v12) and its PR #25966 as well as task ID 1889703 (tests and fixes)
and its PR #27330. Done with collaboration of @dbeguin.
2018-10-02 16:32:53 +02:00