Skip to content
Permalink
Browse files

Test clean

  • Loading branch information...
kebeclibre committed Nov 8, 2019
1 parent 3e4623a commit e792caacb05633135a0caefefa341c14e2bd1540
Showing with 4 additions and 1 deletion.
  1. +4 −1 addons/bus/tests/test_assetsbundle.py
@@ -10,14 +10,17 @@ class BusWebTests(odoo.tests.HttpCase):

def test_bundle_sends_bus(self):
db_name = self.env.registry.db_name
bundle_xml_ids = ('web.assets_common', 'web.assets_backend')
# start from a clean slate
self.env['ir.attachment'].search([('name', 'in', bundle_xml_ids)]).unlink()

send_one_counter = 0
def _patched_sendone(channel, message):
nonlocal send_one_counter
send_one_counter += 1
self.assertEqual(channel, (db_name, 'bundle_changed'))
self.assertEqual(len(message), 2)
self.assertTrue(message[0] in ('web.assets_common', 'web.assets_backend'))
self.assertTrue(message[0] in bundle_xml_ids)
self.assertTrue(isinstance(message[1], str))

with patch('odoo.addons.bus.models.bus.ImBus.sendone', wraps=_patched_sendone, create=True):

0 comments on commit e792caa

Please sign in to comment.
You can’t perform that action at this time.