Skip to content

Commit

Permalink
Add checks for publish behaviour of explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Oct 11, 2024
1 parent b33a58f commit fd6dc5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ooniapi/services/oonifindings/tests/test_oonifindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ def test_oonifinding_publish(client, client_with_hashed_email):
r = client_with_user_role.post("api/v1/incidents/publish", json=incident_payload)
assert r.status_code == 401, "only admins can publish incidents"

incident_payload["id"] = "sample id"
r = client_with_admin_role.post("api/v1/incidents/publish", json=incident_payload)
r = client_with_admin_role.post("api/v1/incidents/publish", json={"id": "12341512"})
assert r.status_code == 404, "valid incident id should be passed"

incident_payload["id"] = incident_id
r = client_with_admin_role.post("api/v1/incidents/publish", json=incident_payload)
r = client_with_admin_role.post(
"api/v1/incidents/publish", json={"id": incident_id}
)
assert r.status_code == 200
assert r.json()["r"] == 1
assert r.json()["id"] == incident_id
Expand Down

0 comments on commit fd6dc5c

Please sign in to comment.