-
-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] website_cookiebot: Migration to 17.0
- Loading branch information
Showing
4 changed files
with
72 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import test_website_cookiebot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>) | ||
# 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) | ||
|
||
def test_conf_cookies_enabled(self): | ||
config = self.env["res.config.settings"].sudo().create({}) | ||
config.write({"cookiebot_enabled": True}) | ||
config._onchange_cookiebot_enabled() | ||
self.assertFalse(config.website_cookies_bar) | ||
self.assertTrue(config.cookiebot_enabled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters