Before [1], only string channels were allowed for polling. This ensured no one could send a server-side channel from the frontend, this PR restores this behavior. [1]: odoo/odoo@a5623d2 closes odoo/odoo#100309 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
14 lines
447 B
Python
14 lines
447 B
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.tests import common
|
|
|
|
|
|
class TestIrWebsocket(common.HttpCase):
|
|
def test_only_allow_string_channels_from_frontend(self):
|
|
with self.assertRaises(ValueError):
|
|
self.env['ir.websocket']._subscribe({
|
|
'inactivity_period': 1000,
|
|
'last': 0,
|
|
'channels': [('odoo', 'mail.channel', 5)],
|
|
})
|