diff --git a/website_cookiebot/__manifest__.py b/website_cookiebot/__manifest__.py index a14c7a2474..37ee70dde1 100644 --- a/website_cookiebot/__manifest__.py +++ b/website_cookiebot/__manifest__.py @@ -5,7 +5,7 @@ "name": "Website Cookiebot", "summary": "Ask for cookies consent connecting with Cookiebot", "category": "Website", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "author": "Trey (www.trey.es), Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/website", "license": "AGPL-3", diff --git a/website_cookiebot/tests/__init__.py b/website_cookiebot/tests/__init__.py new file mode 100644 index 0000000000..3499c95804 --- /dev/null +++ b/website_cookiebot/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_website_cookiebot diff --git a/website_cookiebot/tests/test_website_cookiebot.py b/website_cookiebot/tests/test_website_cookiebot.py new file mode 100644 index 0000000000..af0945cb83 --- /dev/null +++ b/website_cookiebot/tests/test_website_cookiebot.py @@ -0,0 +1,22 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html + +from odoo.tests.common import TransactionCase + + +class TestWebsiteCookiebot(TransactionCase): + def test_conf_cookiebot_domain(self): + domain_group_id = "9a9999a9-aa99-9a99-999a-aa999999999a" + config = self.env["res.config.settings"].sudo().create({}) + config.write({"cookiebot_dgid": domain_group_id}) + self.assertTrue(config.cookiebot_enabled) + self.assertFalse(config.website_cookies_bar) + self.assertEqual(config.cookiebot_dgid, domain_group_id) + + def test_conf_website_cookies_bar(self): + config = self.env["res.config.settings"].sudo().create({}) + config.write({"website_cookies_bar": True}) + config._onchange_website_cookies_bar() + self.assertTrue(config.website_cookies_bar) + self.assertFalse(config.cookiebot_enabled) + self.assertFalse(config.cookiebot_dgid) diff --git a/website_cookiebot/wizards/res_config_settings_views.xml b/website_cookiebot/wizards/res_config_settings_views.xml index f30f8d45b7..5a20724ffe 100644 --- a/website_cookiebot/wizards/res_config_settings_views.xml +++ b/website_cookiebot/wizards/res_config_settings_views.xml @@ -6,53 +6,49 @@ res.config.settings - -
-
- + + + +