diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py index daa76e43b2a..1eceb390587 100644 --- a/addons/http_routing/models/ir_http.py +++ b/addons/http_routing/models/ir_http.py @@ -167,11 +167,7 @@ def url_lang(path_or_uri, lang_code=None): elif lang_url_code != default_lg.url_code or force_lang: ps.insert(1, lang_url_code) - # remove trailing / - # ['', fr', ''] => /fr/ instead of /fr - if ps[-1] == '': - ps.pop(-1) - location = (u'/'.join(ps) or u'/') + sep + qs + location = u'/'.join(ps) + sep + qs return location diff --git a/addons/website/tests/test_lang_url.py b/addons/website/tests/test_lang_url.py index 98a8de4b974..bd021fd66a9 100644 --- a/addons/website/tests/test_lang_url.py +++ b/addons/website/tests/test_lang_url.py @@ -22,7 +22,7 @@ class TestLangUrl(HttpCase): def test_01_url_lang(self): with MockRequest(self.env, website=self.website): - self.assertEqual(url_lang('', '[lang]'), '/[lang]/hello', "`[lang]` is used to be replaced in the url_return after installing a language, it should not be replaced or removed.") + self.assertEqual(url_lang('', '[lang]'), '/[lang]/hello/', "`[lang]` is used to be replaced in the url_return after installing a language, it should not be replaced or removed.") def test_02_url_redirect(self): url = '/fr_WHATEVER/contactus' diff --git a/addons/website/tests/test_qweb.py b/addons/website/tests/test_qweb.py index 8c1dc4d82af..08a3c966cdc 100644 --- a/addons/website/tests/test_qweb.py +++ b/addons/website/tests/test_qweb.py @@ -140,14 +140,14 @@ class TestQwebProcessAtt(TransactionCase): with MockRequest(self.env, website=self.website): self._test_att('/', {'href': '/'}) self._test_att('/en/', {'href': '/'}) - self._test_att('/fr/', {'href': '/fr'}) + self._test_att('/fr/', {'href': '/fr/'}) self._test_att('/fr', {'href': '/fr'}) def test_process_att_with_request_lang(self): with MockRequest(self.env, website=self.website, context={'lang': 'fr_FR'}): - self._test_att('/', {'href': '/fr'}) + self._test_att('/', {'href': '/fr/'}) self._test_att('/en/', {'href': '/'}) - self._test_att('/fr/', {'href': '/fr'}) + self._test_att('/fr/', {'href': '/fr/'}) self._test_att('/fr', {'href': '/fr'}) def test_process_att_matching_cdn_and_lang(self):