summaryrefslogtreecommitdiff
path: root/addons/test_website/controllers/main.py
diff options
context:
space:
mode:
authorlul-odoo <lul@odoo.com>2019-06-27 10:22:55 +0200
committerYannick Tivisse <yti@odoo.com>2019-06-27 10:24:32 +0200
commit7ea21adabe007eff6b5b69aa451d756dff54442b (patch)
treeb2e665fcbbdc7efcab3a585b19659121119bd5ee /addons/test_website/controllers/main.py
parentb2eceae7c927d1b908f8e90e6a911430a7ccfce7 (diff)
[IMP] test_website: Add multi-company test
Purpose ======= This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification ============= The website company should be automatically set in the context as 'allowed_company_ids'. That way, we can remove the switch company menu on the website, which doesn't make a lot of sense. This test enforce this behavior.
Diffstat (limited to 'addons/test_website/controllers/main.py')
-rw-r--r--addons/test_website/controllers/main.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/test_website/controllers/main.py b/addons/test_website/controllers/main.py
index 259072c81ff..ae45d160b06 100644
--- a/addons/test_website/controllers/main.py
+++ b/addons/test_website/controllers/main.py
@@ -36,3 +36,7 @@ class WebsiteTest(Home):
@http.route('/ignore_args/converter/<string:a>/nokw', type='http', auth="public", website=True)
def test_ignore_args_converter_nokw(self, a, b='youhou'):
return request.make_response(json.dumps(dict(a=a, b=b)))
+
+ @http.route('/multi_company_website', type='http', auth="public", website=True)
+ def test_company_context(self):
+ return request.make_response(json.dumps(request.context.get('allowed_company_ids')))