From ab03d9c280dbc34946fc2231abc54ab041a56d29 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 2 Aug 2013 17:08:15 +0200 Subject: Make the three jsonrpc protocols work correctly with and without session overriding and added tests for all the cases. That's one small step for a man, a giant leap for all the poor programmers that would have to use that shit one day. bzr revid: nicolas.vanhoren@openerp.com-20130802150815-k2yuf0b3ku5fvx7a --- addons/web/controllers/testing.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'addons/web/controllers/testing.py') diff --git a/addons/web/controllers/testing.py b/addons/web/controllers/testing.py index 36afbd1e653..b51b12fc53d 100644 --- a/addons/web/controllers/testing.py +++ b/addons/web/controllers/testing.py @@ -13,6 +13,8 @@ from openerp.modules import module from .main import module_topological_sort from .. import http +from ..http import request + NOMODULE_TEMPLATE = Template(u""" @@ -162,3 +164,11 @@ class TestRunnerController(http.Controller): for path in glob.glob(normalized_pattern): # replace OS path separators (from join & normpath) by URI ones yield path[len(root):].replace(os.path.sep, '/') + + @http.route('/web/tests/set_session_value', type='json', auth="none") + def set_session_value(self, value): + request.session.some_test_value = value + + @http.route('/web/tests/get_session_value', type='json', auth="none") + def get_session_value(self): + return request.session.some_test_value \ No newline at end of file -- cgit v1.2.3