Skip to content

Commit

Permalink
test_notes_get_has_created_at_filter_from_and_to passed
Browse files Browse the repository at this point in the history
  • Loading branch information
kota-yata committed Apr 12, 2024
1 parent c59358d commit 39be00a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tests/routers/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ def test_notes_get_has_note_id_filter(client: TestClient, note_samples: List[Not
"data": [json.loads(note_samples[0].model_dump_json()), json.loads(note_samples[2].model_dump_json())]
}


def test_notes_get_has_created_at_filter_from_and_to(client: TestClient, note_samples: List[Note]) -> None:
response = client.get("/api/v1/data/notes/?createdAtFrom=1152921601000&createdAtTo=1152921603000")
assert response.status_code == 200
res_json = response.json()
assert res_json == {"data": [json.loads(note_samples[1].model_dump_json()) for i in (1, 2, 3)]}
assert res_json == {"data": [json.loads(note_samples[i].model_dump_json()) for i in (1, 2, 3)]}


def test_notes_get_has_created_at_filter_from(client: TestClient, note_samples: List[Note]) -> None:
Expand All @@ -54,5 +55,3 @@ def test_notes_get_has_created_at_filter_to(client: TestClient, note_samples: Li
assert response.status_code == 200
res_json = response.json()
assert res_json == {"data": [json.loads(note_samples[i].model_dump_json()) for i in (0, 1, 2, 3)]}


1 change: 0 additions & 1 deletion tests/test_storage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from datetime import datetime, timedelta
from typing import List

from sqlalchemy.engine import Engine
Expand Down

0 comments on commit 39be00a

Please sign in to comment.