Skip to content

Commit

Permalink
[FIX] mass_mailing_sms: fix sms link placeholders tests
Browse files Browse the repository at this point in the history
In no-demo tests, there is no link tracker, so
the expected length is not max+1 but 3.

Follow up of e5b88d3

Task-3502174

closes odoo#173303

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
  • Loading branch information
flch-odoo committed Jul 24, 2024
1 parent c5852cf commit 074ea09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/mass_mailing_sms/tests/test_mailing_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ def test_mailing_get_sms_link_replacements_placeholders(self):
})
base_url = self.env['mailing.mailing'].get_base_url()

link_trackers = bool(self.env['link.tracker'].search([], limit=1)) # depends on demo

expected = {
'link': f'{base_url}/r/xxxx/s/xxxxx',
'link': f'{base_url}/r/xxx{"x" if link_trackers else ""}/s/xxxxx',
'unsubscribe': f"\nSTOP SMS : {base_url}/sms/{'x' * len(str(mailing.id))}/{'x' * self.env['mailing.trace'].CODE_SIZE}",
}
self.assertDictEqual(mailing.get_sms_link_replacements_placeholders(), expected)
Expand Down

0 comments on commit 074ea09

Please sign in to comment.