[MIG] report_xlsx: Migration to 14.0

This commit is contained in:
Alex Cuellar
2020-10-19 15:42:11 -05:00
parent 155d1e07cd
commit 5231d53a21
7 changed files with 26 additions and 21 deletions

View File

@@ -27,7 +27,7 @@ class TestReport(common.TransactionCase):
def test_report(self):
report = self.report
self.assertEqual(report.report_type, "xlsx")
rep = report.render(self.docs.ids, {})
rep = report._render(self.docs.ids, {})
wb = open_workbook(file_contents=rep[0])
sheet = wb.sheet_by_index(0)
self.assertEqual(sheet.cell(0, 0).value, self.docs.name)
@@ -38,20 +38,20 @@ class TestReport(common.TransactionCase):
objs = self.xlsx_report._get_objs_for_report(
False, {"context": {"active_ids": self.docs.ids}}
)
self.assertEquals(objs, self.docs)
self.assertEqual(objs, self.docs)
# Typical call from within code not to report_action
objs = self.xlsx_report.with_context(
active_ids=self.docs.ids
)._get_objs_for_report(False, False)
self.assertEquals(objs, self.docs)
self.assertEqual(objs, self.docs)
# Typical call from WebUI
objs = self.xlsx_report._get_objs_for_report(
self.docs.ids, {"data": [self.report_name, self.report.report_type]}
)
self.assertEquals(objs, self.docs)
self.assertEqual(objs, self.docs)
# Typical call from render
objs = self.xlsx_report._get_objs_for_report(self.docs.ids, {})
self.assertEquals(objs, self.docs)
self.assertEqual(objs, self.docs)