feat: add agreements foundation

This commit is contained in:
Александр Арсентьев
2026-09-25 18:41:08 +03:00
parent 2376778828
commit d0b5745f8f
14 changed files with 697 additions and 61 deletions
+4 -2
View File
@@ -107,8 +107,6 @@ def test_project_edit_real_file_import_and_daily_report_flow(tmp_path):
assert project.name == "Dashboard regression project"
item = next(item for item in imported if item.quantity and item.unit_price)
item_id, new_system_id, quantity = item.id, item.system_id, item.quantity
expected_percent = (Decimal(str(item.unit_price)) * Decimal(str(quantity)) /
Decimal("18600000") * Decimal("100"))
document_page = client.get(f"/boq/2/documents/{latest_document_id}")
assert document_page.status_code == 200
@@ -123,6 +121,10 @@ def test_project_edit_real_file_import_and_daily_report_flow(tmp_path):
assert client.get(created_report.headers["location"]).status_code == 200
with TestingSession() as session:
assert session.query(DailyReport).filter_by(project_id=2).count() == daily_report_count_before_new + 1
with TestingSession() as session:
from app.services.project_dashboard import build_project_dashboard
project = session.get(Project, 2)
expected_percent = build_project_dashboard(session, project)["completion_percent"]
updated_dashboard = client.get("/projects/2")
assert updated_dashboard.status_code == 200
assert f"{expected_percent:.4f}%" in updated_dashboard.text