From 10c8e19d940cbbe329ea0b2572b24310b7fc5949 Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Thu, 24 Sep 2026 00:08:38 +0800 Subject: [PATCH] =?UTF-8?q?test(resources):=20=E5=88=A0=E9=99=A4=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4=20-=20=E6=9B=B4=E6=96=B0=E5=8D=95=E7=B4=A0=E6=9D=90?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/handler/asset_delete_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/internal/handler/asset_delete_test.go b/backend/internal/handler/asset_delete_test.go index 9225100ff..de317887c 100644 --- a/backend/internal/handler/asset_delete_test.go +++ b/backend/internal/handler/asset_delete_test.go @@ -107,7 +107,7 @@ func TestAssetBatchDeleteHTTP(t *testing.T) { } assertAssets(1) - // The existing DELETE endpoint uses the same purge policy for non-archived assets. + // The DELETE endpoint protects referenced assets just like batch deletion. resource := model.Resource{ID: "single-resource", UserID: "batch-user", Provider: "unsupported-test-provider", ObjectKey: "single.png"} payload := `{"url":"/api/resources/single-resource/file"}` for _, record := range []any{ @@ -119,8 +119,8 @@ func TestAssetBatchDeleteHTTP(t *testing.T) { t.Fatal(err) } } - if w := call(http.MethodDelete, "/api/assets/single", "", true); w.Code != http.StatusOK { + if w := call(http.MethodDelete, "/api/assets/single", "", true); w.Code != http.StatusBadRequest { t.Fatalf("single referenced delete: %d %s", w.Code, w.Body.String()) } - assertAssets(1) + assertAssets(2) }