-
-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] auth_signup: don't remove actual content from email templates
such as auth_signup's invitation email.
- Loading branch information
1 parent
0f0eb13
commit a6e39eb
Showing
7 changed files
with
80 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Known issues: | ||
|
||
* Not all branding is removed from auth_signup's invitation email because it is a | ||
longer, more complex snippet of HTML. Only the line containing the link to Odoo.com | ||
is removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import test_mail_debrand | ||
from . import test_mail_debrand_digest | ||
from . import test_mail_debrand_signup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from odoo.tests import TransactionCase, tagged | ||
|
||
|
||
@tagged("-at_install", "post_install") | ||
class TestMailDebrandSignup(TransactionCase): | ||
def _has_module(self): | ||
module = self.env["ir.module.module"].search([("name", "=", "auth_signup")]) | ||
self.assertTrue(module) | ||
return module.state == "installed" | ||
|
||
def test_debrand_auth_signup_set_password_email(self): | ||
if not self._has_module(): | ||
return | ||
template = self.env.ref( | ||
"auth_signup.set_password_email", | ||
) | ||
self.assertIn("www.odoo.com", template.body_html) | ||
self.assertIn("Accept invitation", template.body_html) | ||
self.assertIn("to discover the tool", template.body_html) | ||
|
||
mail_id = template.send_mail(self.env.user.id) | ||
body = self.env["mail.mail"].browse(mail_id).body_html | ||
|
||
# The essential button is preserved | ||
self.assertIn("Accept invitation", body) | ||
# But at least part of the branding was removed | ||
self.assertNotIn("www.odoo.com", body) | ||
self.assertNotIn("to discover the tool", body) |