Commit c7c44afc authored by Jérome Perrin's avatar Jérome Perrin

ERP5ReportTestCase: getObject before the try/finally

Errors in getObject (typically, unauthorized) were hidden by another
error in finally block, because popRequest can only be called if
pushRequest was executed before.
parent 0a29d9c1
Pipeline #28082 failed with stage
......@@ -1417,13 +1417,13 @@ class ERP5ReportTestCase(ERP5TypeTestCase):
in the report_section.
"""
result = None
here = report_section.getObject(self.portal)
# Use an independent request, because this is what happens when using
# deferred style
request_form = self.portal.REQUEST.form
try:
# XXX maybe there is better API than just replacing the dict
self.portal.REQUEST.form = dict()
here = report_section.getObject(self.portal)
report_section.pushReport(self.portal)
form = getattr(here, report_section.getFormId())
self.portal.REQUEST['here'] = here
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment