-
-
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 16.0
- Loading branch information
1 parent
d6c32de
commit 5abf5da
Showing
5 changed files
with
31 additions
and
6 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.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_res_config_settings |
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,25 @@ | ||
# Copyright 2021 NICO SOLUTIONS - ENGINEERING & IT, Nils Coenen | ||
# License APL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestResConfigSettings(TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestResConfigSettings, self).setUp() | ||
self.res_config_settings = self.env["res.config.settings"].create({ | ||
"website_id": self.env["website"].create({ | ||
"name": "Test Website", | ||
"cookiebot_dgid": "test_dgid" | ||
}) | ||
}) | ||
|
||
def test_compute_cookiebot_enabled(self): | ||
self.res_config_settings._compute_cookiebot_enabled() | ||
self.assertTrue(self.res_config_settings.cookiebot_enabled) | ||
|
||
def test_compute_cookiebot_enabled_no_dgid(self): | ||
self.res_config_settings.website_id.cookiebot_dgid = False | ||
self.res_config_settings._compute_cookiebot_enabled() | ||
self.assertFalse(self.res_config_settings.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
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