Skip to content

Commit 207bbca

Browse files
committed
Fix openpyxl deprecation warnings
Signed-off-by: tdruez <[email protected]>
1 parent 2492576 commit 207bbca

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

scanpipe/tests/pipes/test_output.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def test_scanpipe_pipes_outputs_to_xlsx(self):
234234
"MESSAGES",
235235
"TODOS",
236236
]
237-
self.assertEqual(expected_sheet_names, workbook.get_sheet_names())
237+
self.assertEqual(expected_sheet_names, workbook.sheetnames)
238238

239239
def test_scanpipe_pipes_outputs_get_xlsx_report(self):
240240
project_qs = None
@@ -259,15 +259,15 @@ def test_scanpipe_pipes_outputs_get_xlsx_report(self):
259259
expected_sheet_names = [
260260
"PACKAGES",
261261
]
262-
self.assertEqual(expected_sheet_names, workbook.get_sheet_names())
262+
self.assertEqual(expected_sheet_names, workbook.sheetnames)
263263

264264
model_short_name = "todo"
265265
output_file = output.get_xlsx_report(project_qs, model_short_name)
266266
workbook = openpyxl.load_workbook(output_file, read_only=True, data_only=True)
267267
expected_sheet_names = [
268268
"TODOS",
269269
]
270-
self.assertEqual(expected_sheet_names, workbook.get_sheet_names())
270+
self.assertEqual(expected_sheet_names, workbook.sheetnames)
271271

272272
def test_scanpipe_pipes_outputs_get_xlsx_fields_order(self):
273273
output_file = output.to_xlsx(project=make_project())

scanpipe/tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def test_scanpipe_api_project_action_report(self):
704704

705705
output_file = io.BytesIO(b"".join(response.streaming_content))
706706
workbook = openpyxl.load_workbook(output_file, read_only=True, data_only=True)
707-
self.assertEqual(["PACKAGES"], workbook.get_sheet_names())
707+
self.assertEqual(["PACKAGES"], workbook.sheetnames)
708708

709709
todos_sheet = workbook.get_sheet_by_name("PACKAGES")
710710
rows = list(todos_sheet.values)

scanpipe/tests/test_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ def test_scanpipe_management_command_report(self):
12801280
self.assertIn(f"Report generated at {output_file}", out.getvalue())
12811281

12821282
workbook = openpyxl.load_workbook(output_file, read_only=True, data_only=True)
1283-
self.assertEqual(["TODOS"], workbook.get_sheet_names())
1283+
self.assertEqual(["TODOS"], workbook.sheetnames)
12841284
todos_sheet = workbook.get_sheet_by_name("TODOS")
12851285
header = list(todos_sheet.values)[0]
12861286

scanpipe/tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def test_scanpipe_views_project_action_report_view(self):
237237

238238
output_file = io.BytesIO(b"".join(response.streaming_content))
239239
workbook = openpyxl.load_workbook(output_file, read_only=True, data_only=True)
240-
self.assertEqual(["TODOS"], workbook.get_sheet_names())
240+
self.assertEqual(["TODOS"], workbook.sheetnames)
241241

242242
def test_scanpipe_views_project_action_reset_view(self):
243243
url = reverse("project_action")

0 commit comments

Comments
 (0)