You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
971 B

from openerp.tests.common import HttpCase, TransactionCase
class TestWebShortcut(TransactionCase):
def setUp(self, *args, **kwargs):
super(TestWebShortcut, self).setUp(*args, **kwargs)
self.shortcut_obj = self.env['web.shortcut']
self.menu_obj = self.env['ir.ui.menu']
self.menu = self.env.ref('base.menu_ir_property')
self.user = self.env.ref('base.user_root')
self.shortcut_obj.search([('user_id', '=', self.user.id)]).unlink()
def test_web_shortcut(self):
res = self.shortcut_obj.get_user_shortcuts()
self.assertEqual(len(res), 0)
self.shortcut_obj.create({
'name': 'Test',
'menu_id': self.menu.id,
'user_id': self.env.user.id
})
res = self.shortcut_obj.get_user_shortcuts()
self.assertEqual(len(res), 1)
self.menu.unlink()
res = self.shortcut_obj.get_user_shortcuts()
self.assertEqual(len(res), 0)