Commit f8cf9d19 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

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 ff13f2d2
......@@ -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