[FIX] website: fix semantics of MockRequest
We should push the request object on the request stack only in the __enter__ method, in order to be symmetrical with the __exit__ method. closes odoo/odoo#53613 X-original-commit: 30e94d305f9cffa816ddc213e0b9329c0263c145 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
This commit is contained in:
@@ -116,9 +116,9 @@ class MockRequest(object):
|
||||
},
|
||||
'website': kw.get('website'),
|
||||
})
|
||||
odoo.http._request_stack.push(self.request)
|
||||
|
||||
def __enter__(self):
|
||||
odoo.http._request_stack.push(self.request)
|
||||
return self.request
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
|
||||
Reference in New Issue
Block a user