Skip to content

Commit a8c87ce

Browse files
committed
Add test to assert delete queue item requires authn
1 parent 136f790 commit a8c87ce

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/test_router.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ async def test_delete_queue_item_by_id_item_doesnt_exist(
134134
assert resp.status_code == 404
135135

136136

137+
@pytest.mark.asyncio
138+
async def test_delete_queue_item_by_id_requires_authn(
139+
dl_queue, anon_client, webhook_request_factory
140+
):
141+
item = webhook_request_factory(event__time=datetime(1982, 5, 8, 9, 10))
142+
await dl_queue.track_failed(item, Exception("boom"), rid="rid")
143+
144+
resp = anon_client.delete(
145+
"/dl_queue/1982-05-08%2009:10:00+00:00-654321-create-error"
146+
)
147+
assert resp.status_code == 401
148+
149+
137150
def test_powered_by_jbi(exclude_middleware, authenticated_client):
138151
resp = authenticated_client.get("/powered_by_jbi/")
139152
html = resp.text

0 commit comments

Comments
 (0)