From 83e9b8c701f92e8651a9ebefa91495617c138577 Mon Sep 17 00:00:00 2001 From: kota-yata Date: Fri, 12 Apr 2024 15:04:49 +0900 Subject: [PATCH] test_notes_get_has_created_at_filter_from_and_to passed --- tests/routers/test_data.py | 5 ++--- tests/test_storage.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/routers/test_data.py b/tests/routers/test_data.py index 47ce0e5..8f719f7 100644 --- a/tests/routers/test_data.py +++ b/tests/routers/test_data.py @@ -98,11 +98,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: @@ -117,5 +118,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)]} - - diff --git a/tests/test_storage.py b/tests/test_storage.py index 0d9cc1a..4865e54 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -1,4 +1,3 @@ -from datetime import datetime, timedelta from typing import List from sqlalchemy.engine import Engine