Skip to content

Commit 4cedd0c

Browse files
committed
chore: remove deprecation warning and prepare for future
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent e49d1ad commit 4cedd0c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

product_portfolio/tests/test_api.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,13 @@ def test_api_product_endpoint_import_from_scan_action(self):
476476
self.assertEqual(expected, response.data)
477477

478478
scan_input_location = self.testfiles_path / "import_from_scan.json"
479-
data = {
480-
"upload_file": scan_input_location.open(),
481-
"create_codebase_resources": True,
482-
"stop_on_error": False,
483-
}
484-
response = self.client.post(url, data)
479+
with scan_input_location.open() as upload_file:
480+
data = {
481+
"upload_file": upload_file,
482+
"create_codebase_resources": True,
483+
"stop_on_error": False,
484+
}
485+
response = self.client.post(url, data)
485486
self.assertEqual(status.HTTP_200_OK, response.status_code)
486487
expected = {
487488
"status": "Imported from Scan: 1 Packages, 1 Product Packages, 3 Codebase Resources"

0 commit comments

Comments
 (0)