diff options
| author | Dharmraj Jhala <dja@odoo.com> | 2020-07-08 09:04:24 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-07-27 08:04:10 +0000 |
| commit | 297c3d83785453b6a273af324a955d9d038e989d (patch) | |
| tree | 6029cd901a0266cb93e79d2c5336eadc6fece46e /addons/mass_mailing_sms | |
| parent | c5d98aeccbdda566f3559b6c02b4bed2d0c58b21 (diff) | |
[IMP] mass_mailing_sms: improve shortened URL detection in tests
Before this commit, in gateway tools, we used to consider URL as a
shortened which was having `/r` in it. However this is not true in
all cases. Any random URL can have `/r` in it but it might not be
a shortened one. It caused random failures on runbot time to time.
This commit makes a bit precise search (`/r/`) to consider URL as
a shortened one and thus avoiding those random test failures on the
runbot.
TaskID - 2276386
closes odoo/odoo#54944
X-original-commit: b8045b49d0693292e6240dfb3acd7c9a6450ad77
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/mass_mailing_sms')
| -rw-r--r-- | addons/mass_mailing_sms/tests/common.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mass_mailing_sms/tests/common.py b/addons/mass_mailing_sms/tests/common.py index 67b8a4d38ee..0f015865256 100644 --- a/addons/mass_mailing_sms/tests/common.py +++ b/addons/mass_mailing_sms/tests/common.py @@ -19,7 +19,7 @@ class MassSMSCase(SMSCase): a number, find an SMS sent to him, find shortened links in its body and call add_click to simulate a click. """ for url in re.findall(tools.TEXT_URL_REGEX, sent_sms['body']): - if '/r' in url: # shortened link, like 'http://localhost:8069/r/LBG/s/53' + if '/r/' in url: # shortened link, like 'http://localhost:8069/r/LBG/s/53' parsed_url = werkzeug.urls.url_parse(url) path_items = parsed_url.path.split('/') code, sms_sms_id = path_items[2], int(path_items[4]) |
