From d5a7a92e3063eb375dfadd328265a9049630194d Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Thu, 15 Aug 2024 08:30:06 -0400 Subject: [PATCH] bug-1910180: fix file upload upload info try_symbols value This carries the try_symbols value from the Upload instance to the file upload upload info section in the frontend. --- tecken/api/views.py | 1 + tecken/tests/test_api.py | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/tecken/api/views.py b/tecken/api/views.py index 3d617ad3b..8745708bc 100644 --- a/tecken/api/views.py +++ b/tecken/api/views.py @@ -557,6 +557,7 @@ def upload_file(request, id): "user": {"id": upload_obj.user.id, "email": upload_obj.user.email}, "size": upload_obj.size, "bucket_name": upload_obj.bucket_name, + "try_symbols": upload_obj.try_symbols, "skipped_keys": upload_obj.skipped_keys or [], "ignored_keys": upload_obj.ignored_keys or [], "download_url": upload_obj.download_url, diff --git a/tecken/tests/test_api.py b/tecken/tests/test_api.py index 232a6848a..7a1f931c2 100644 --- a/tecken/tests/test_api.py +++ b/tecken/tests/test_api.py @@ -1136,8 +1136,42 @@ def test_file_upload_try_upload(client): url = reverse("api:upload_file", args=(file_upload.id,)) response = client.get(url) assert response.status_code == 200 - data = response.json()["file"] - assert data["url"] == "/foo.pdb/deadbeaf123/foo.sym?try" + data = response.json() + assert data == { + "file": { + "bucket_name": "", + "code_file": None, + "code_id": None, + "completed_at": None, + "compressed": False, + "created_at": ANY, + "debug_filename": None, + "debug_id": None, + "generator": None, + "id": file_upload.id, + "key": "foo.pdb/deadbeaf123/foo.sym", + "size": 1234, + "update": False, + "upload": { + "bucket_name": "", + "completed_at": None, + "created_at": ANY, + "download_url": None, + "filename": "", + "id": upload.id, + "ignored_keys": [], + "redirect_urls": [], + "size": 123_456, + "skipped_keys": [], + "try_symbols": True, + "user": { + "email": "peterbe@example.com", + "id": user.id, + }, + }, + "url": "/foo.pdb/deadbeaf123/foo.sym?try", + } + } class Test_syminfo: