-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs in oonifindings related to Explorer integration (#891)
* Make publish behave like current backend * Add checks for publish behaviour of explorer * Setting of ID in creation is optional
- Loading branch information
Showing
2 changed files
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
SAMPLE_EMAIL = "[email protected]" | ||
|
||
SAMPLE_OONIFINDING = { | ||
"id": "", | ||
"title": "sample oonifinding", | ||
"short_description": "sample oonifinding description", | ||
"reported_by": "sample user", | ||
|
@@ -148,12 +147,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 | ||
|