feat: Add currency and unit support across models, routes, and templates; enhance UI for consumption, costs, and production
This commit is contained in:
@@ -25,6 +25,8 @@ def test_create_consumption(client: TestClient) -> None:
|
||||
"scenario_id": scenario_id,
|
||||
"amount": 125.5,
|
||||
"description": "Fuel usage baseline",
|
||||
"unit_name": "Liters",
|
||||
"unit_symbol": "L",
|
||||
}
|
||||
|
||||
response = client.post("/api/consumption/", json=payload)
|
||||
@@ -34,6 +36,7 @@ def test_create_consumption(client: TestClient) -> None:
|
||||
assert body["scenario_id"] == scenario_id
|
||||
assert body["amount"] == pytest.approx(125.5)
|
||||
assert body["description"] == "Fuel usage baseline"
|
||||
assert body["unit_symbol"] == "L"
|
||||
|
||||
|
||||
def test_list_consumption_returns_created_items(client: TestClient) -> None:
|
||||
@@ -46,6 +49,8 @@ def test_list_consumption_returns_created_items(client: TestClient) -> None:
|
||||
"scenario_id": scenario_id,
|
||||
"amount": amount,
|
||||
"description": f"Consumption {amount}",
|
||||
"unit_name": "Tonnes",
|
||||
"unit_symbol": "t",
|
||||
},
|
||||
)
|
||||
assert response.status_code == 201
|
||||
|
||||
Reference in New Issue
Block a user