diff options
| author | Thibault Delavallée <tde@odoo.com> | 2020-03-11 12:42:48 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-03-24 10:25:04 +0000 |
| commit | aaefa35e29f7e87e8e914cf1d9eb68af7d26464a (patch) | |
| tree | 0835ddf9cea2ffebfa0ca441411b32e3fa1db502 /addons/test_mail_full | |
| parent | 3d86a29aeb21c7e5812c988866117a495f20ebed (diff) | |
[MOV] link_tracker, various: more link shortening tools to mail.render.mixin
PURPOSE
Move links shortening tools on mail.render.mixin to have rendering and
post procesing tools available on that mixin.
SPECIFICATIONS
Move html and text links shortening methods on mail.render.mixin class.
That way rendering and post processing is done in that mixin instead of
being specific to link.tracker model. Indeed those methods are tools and
not really business related methods.
Future commits will improve the way mail and sms composer use the render
mixin. This commit is therefore both a cleaning and preparing commit.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
Diffstat (limited to 'addons/test_mail_full')
| -rw-r--r-- | addons/test_mail_full/tests/test_sms_sms.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/test_mail_full/tests/test_sms_sms.py b/addons/test_mail_full/tests/test_sms_sms.py index de7e37ac641..e404eaec572 100644 --- a/addons/test_mail_full/tests/test_sms_sms.py +++ b/addons/test_mail_full/tests/test_sms_sms.py @@ -64,7 +64,7 @@ class TestSMSPost(test_mail_full_common.TestSMSCommon, LinkTrackerMock): def test_body_link_shorten(self): link = 'http://www.example.com' self.env['link.tracker'].search([('url', '=', link)]).unlink() - new_body = self.env['link.tracker']._convert_links_text('Welcome to %s !' % link, self.tracker_values) + new_body = self.env['mail.render.mixin']._shorten_links_text('Welcome to %s !' % link, self.tracker_values) self.assertNotIn(link, new_body) self.assertLinkTracker(link, {'utm_campaign': self.utm_c.name, 'utm_medium': self.utm_m.name}) link = self.env['link.tracker'].search([('url', '=', link)]) @@ -72,7 +72,7 @@ class TestSMSPost(test_mail_full_common.TestSMSCommon, LinkTrackerMock): link = 'https://test.odoo.com/my/super_page?test[0]=42&toto=áâà#title3' self.env['link.tracker'].search([('url', '=', link)]).unlink() - new_body = self.env['link.tracker']._convert_links_text('Welcome to %s !' % link, self.tracker_values) + new_body = self.env['mail.render.mixin']._shorten_links_text('Welcome to %s !' % link, self.tracker_values) self.assertNotIn(link, new_body) self.assertLinkTracker(link, { 'utm_campaign': self.utm_c.name, @@ -86,14 +86,14 @@ class TestSMSPost(test_mail_full_common.TestSMSCommon, LinkTrackerMock): def test_body_link_shorten_wshort(self): link = 'https://test.odoo.com/r/RAOUL' self.env['link.tracker'].search([('url', '=', link)]).unlink() - new_body = self.env['link.tracker']._convert_links_text('Welcome to %s !' % link, self.tracker_values) + new_body = self.env['mail.render.mixin']._shorten_links_text('Welcome to %s !' % link, self.tracker_values) self.assertIn(link, new_body) self.assertFalse(self.env['link.tracker'].search([('url', '=', link)])) def test_body_link_shorten_wunsubscribe(self): link = 'https://test.odoo.com/sms/3/' self.env['link.tracker'].search([('url', '=', link)]).unlink() - new_body = self.env['link.tracker']._convert_links_text('Welcome to %s !' % link, self.tracker_values) + new_body = self.env['mail.render.mixin']._shorten_links_text('Welcome to %s !' % link, self.tracker_values) self.assertIn(link, new_body) self.assertFalse(self.env['link.tracker'].search([('url', '=', link)])) |
