Previous commit introduce an helper to get the most suited URL for a record instead of always using the ICP, which is not correct in a website context. This commit replaces calls to ICP by the helper method. Community: https://github.com/odoo/odoo/pull/68201 Enterprise: https://github.com/odoo/enterprise/pull/17538 Upgrade: https://github.com/odoo/upgrade/pull/2372 task-2476101
23 lines
729 B
Python
23 lines
729 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import werkzeug
|
|
|
|
from odoo.addons.mass_mailing.tests.common import MassMailCommon
|
|
from odoo.tests.common import HttpCase
|
|
|
|
|
|
class TestMassMailingControllers(MassMailCommon, HttpCase):
|
|
|
|
def test_tracking_url_token(self):
|
|
mail_mail = self.env['mail.mail'].create({})
|
|
|
|
response = self.url_open(mail_mail._get_tracking_url())
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
base_url = mail_mail.get_base_url()
|
|
url = werkzeug.urls.url_join(base_url, 'mail/track/%s/fake_token/blank.gif' % mail_mail.id)
|
|
|
|
response = self.url_open(url)
|
|
self.assertEqual(response.status_code, 400)
|