Skip to content

Commit

Permalink
Add failing test for end_time returning
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Oct 11, 2024
1 parent ab4289d commit 8cffd06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ooniapi/services/oonifindings/tests/test_oonifindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"%Y-%m-%dT%H:%M:%S.%fZ"
)

sample_end_time = (utcnow_seconds() + timedelta(days=30)).strftime(
"%Y-%m-%dT%H:%M:%S.%fZ"
)

SAMPLE_EMAIL = "[email protected]"

SAMPLE_OONIFINDING = {
Expand Down Expand Up @@ -449,6 +453,8 @@ def test_oonifinding_create(client, client_with_hashed_email, client_with_user_r
z["slug"] = "this-is-my-slug"
z["ASNs"] = [1234]
z["published"] = True
z["start_time"] = sample_start_time
z["end_time"] = sample_end_time

r = client_with_admin_role.post("api/v1/incidents/create", json=z)
assert r.status_code == 200
Expand All @@ -463,6 +469,8 @@ def test_oonifinding_create(client, client_with_hashed_email, client_with_user_r
j = r.json()
print(j)
assert j["incident"]["themes"] == ["social_media"]
assert j["incident"]["start_time"] == sample_start_time
assert j["incident"]["end_time"] == sample_end_time

r = client.get(f"api/v1/incidents/show/this-is-my-slug")
assert r.status_code == 200
Expand Down

0 comments on commit 8cffd06

Please sign in to comment.