from odoo.tests.common import TransactionCase, tagged @tagged('post_install', '-at_install') class TestTheme(TransactionCase): def test_default_colors_are_neutral(self): primary = self.env['ir.config_parameter'].sudo().get_param( 'community_theme_base.primary_color', '#2C3E50' ) self.assertEqual(primary, '#2C3E50') html = self.env['ir.qweb']._render('community_theme_base.theme_css_vars') self.assertIn('#2C3E50', html, "Unconfigured deployments should render the neutral default") def test_custom_color_reflected_in_css_vars_render(self): self.env['ir.config_parameter'].sudo().set_param('community_theme_base.primary_color', '#123456') html = self.env['ir.qweb']._render('community_theme_base.theme_css_vars') self.assertIn('#123456', html) def test_report_basic_layout_includes_theme_css_vars(self): self.env['ir.config_parameter'].sudo().set_param('community_theme_base.primary_color', '#FEDCBA') html = self.env['ir.qweb']._render('web.basic_layout', {'doc': self.env.company}) self.assertIn('#FEDCBA', html)