|
1 | 1 | # Part of Odoo. See LICENSE file for full copyright and licensing details. |
2 | 2 |
|
3 | 3 | from unittest.mock import patch |
| 4 | + |
| 5 | +from odoo.addons.http_routing.tests.common import MockRequest |
4 | 6 | from odoo.tests import standalone |
5 | 7 |
|
6 | 8 |
|
@@ -63,12 +65,15 @@ def fake_olg_api(self, path, payload): |
63 | 65 | template_key = f'website.configurator_{page}_{snippet}' |
64 | 66 | assert template_key in template_keys, f"{template_key} should exist" |
65 | 67 |
|
66 | | - env['website'].with_context(website_id=1).configurator_apply( |
67 | | - selected_features=[1, 2, 3, 4], |
68 | | - industry_id=2836, |
69 | | - industry_name='private university', |
70 | | - selected_palette='default-15', |
71 | | - theme_name='theme_bewise', |
72 | | - website_purpose='get_leads', |
73 | | - website_type='business', |
74 | | - ) |
| 68 | + website = env['website'].search([], limit=1) |
| 69 | + website.ensure_one() |
| 70 | + with MockRequest(env, website=website): |
| 71 | + website.configurator_apply( |
| 72 | + selected_features=[1, 2, 3, 4], |
| 73 | + industry_id=2836, |
| 74 | + industry_name='private university', |
| 75 | + selected_palette='default-15', |
| 76 | + theme_name='theme_bewise', |
| 77 | + website_purpose='get_leads', |
| 78 | + website_type='business', |
| 79 | + ) |
0 commit comments