feat: add dex_report_date to AssetCreate model + test for no_dex_days filter
- Add dex_report_date field to AssetCreate Pydantic model - Include dex_report_date in _build_asset_insert columns/values - Add test_list_assets_filter_no_dex_days test (11/11 pass)
This commit is contained in:
@@ -1777,6 +1777,15 @@ class TestListAssetsExtendedFilters:
|
||||
assert len(data) == 1
|
||||
assert data[0]["name"] == "Match"
|
||||
|
||||
def test_list_assets_filter_no_dex_days(self, client):
|
||||
"""no_dex_days=N returns assets with no dex report or older than N days."""
|
||||
client.post("/api/assets", json={"machine_id": "DEX1", "name": "HasDex", "dex_report_date": "2026-05-23"})
|
||||
client.post("/api/assets", json={"machine_id": "DEX2", "name": "NoDex"})
|
||||
r = client.get("/api/assets?no_dex_days=5")
|
||||
data = r.json()
|
||||
assert len(data) == 1
|
||||
assert data[0]["name"] == "NoDex"
|
||||
|
||||
|
||||
# ─── Phase C: Users API ──────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user