from odoo.tests.common import TransactionCase class TestTheme(TransactionCase): def test_two_branded_companies_exist(self): main = self.env.ref("base.main_company") self.assertEqual(main.name, "St. Aloysius Public School") # No currency assertion here on purpose: base.main_company's # currency is deliberately left untouched by this module (see the # comment in demo/mc_theme_demo.xml) - changing it would fail # once any financial module has posted journal items for this # company, which a combined install of the full suite does # before this module's demo data runs. self.assertTrue(main.logo) waterloo = self.env.ref("mc_education_theme.demo_company_waterloo_heights") self.assertEqual(waterloo.name, "Waterloo Heights Academy") self.assertEqual(waterloo.currency_id, self.env.ref("base.CAD")) self.assertTrue(waterloo.logo) # The "swap" is switching companies - each must actually be # distinct, not the same record twice under different refs. self.assertNotEqual(main.id, waterloo.id) def test_portal_sidebar_has_no_odoo_branding(self): html = str(self.env["ir.qweb"]._render("portal.portal_record_sidebar", { "classes": "", "title": False, "entries": False, })) self.assertNotIn("Powered by", html) self.assertNotIn("odoo.com", html) self.assertNotIn("Odoo Logo", html)