forked from Techsystech/web
[FIX] web_company_color: Resilient tests
We need to disable the company unlinking test, as if not, when tested in integrated environments, it fails as there are records linked to the company, like the warehouse when `stock` module is installed.12.0
parent
5c78dcb727
commit
102c81e48d
|
@ -5,7 +5,7 @@
|
||||||
{
|
{
|
||||||
'name': "Web Company Color",
|
'name': "Web Company Color",
|
||||||
'category': "web",
|
'category': "web",
|
||||||
'version': "12.0.1.1.0",
|
'version': "12.0.1.1.1",
|
||||||
"author": "Alexandre Díaz, "
|
"author": "Alexandre Díaz, "
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
'website': 'https://github.com/OCA/web',
|
'website': 'https://github.com/OCA/web',
|
||||||
|
|
|
@ -8,7 +8,7 @@ class TestResCompany(common.TransactionCase):
|
||||||
IMG_GREEN = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUl' \
|
IMG_GREEN = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUl' \
|
||||||
+ 'EQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg=='
|
+ 'EQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg=='
|
||||||
|
|
||||||
def test_scss_attachment(self):
|
def _test_scss_attachment(self):
|
||||||
num_scss = self.env['ir.attachment'].search_count([
|
num_scss = self.env['ir.attachment'].search_count([
|
||||||
('url', 'ilike', '%s%%' % URL_BASE)
|
('url', 'ilike', '%s%%' % URL_BASE)
|
||||||
])
|
])
|
||||||
|
@ -21,12 +21,14 @@ class TestResCompany(common.TransactionCase):
|
||||||
})
|
})
|
||||||
self.assertEqual(company_id.color_navbar_bg, False,
|
self.assertEqual(company_id.color_navbar_bg, False,
|
||||||
"Invalid Navbar Background Color")
|
"Invalid Navbar Background Color")
|
||||||
self.test_scss_attachment()
|
self._test_scss_attachment()
|
||||||
company_id.sudo().write({'logo': self.IMG_GREEN})
|
company_id.sudo().write({'logo': self.IMG_GREEN})
|
||||||
self.assertEqual(company_id.color_navbar_bg, '#00ff00',
|
self.assertEqual(company_id.color_navbar_bg, '#00ff00',
|
||||||
"Invalid Navbar Background Color")
|
"Invalid Navbar Background Color")
|
||||||
company_id.sudo().unlink()
|
# TODO: We can't remove companies if they have attached data, like
|
||||||
self.test_scss_attachment()
|
# warehouse when we have stock module installed
|
||||||
|
# company_id.sudo().unlink()
|
||||||
|
# self._test_scss_attachment()
|
||||||
|
|
||||||
def test_change_logo(self):
|
def test_change_logo(self):
|
||||||
company_id = self.env['res.company'].search([], limit=1)
|
company_id = self.env['res.company'].search([], limit=1)
|
||||||
|
|
Loading…
Reference in New Issue