various bug fixes Sunday 20260301 5:15pm

This commit is contained in:
2026-03-01 23:44:47 +00:00
parent bcb0007217
commit 9dedf6dbf2
9 changed files with 2078 additions and 254 deletions

View File

@@ -33,10 +33,13 @@ from tests.form_factory import build_form_data, build_edit_data
_CREATE_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.CREATE and not r.has_file_upload]
_EDIT_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.EDIT and not r.has_file_upload]
_DELETE_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.DELETE]
_ACTION_ROUTES = [r for r in ALL_ROUTES if r.kind in (RouteKind.ACTION, RouteKind.TOGGLE)]
# Destructive actions that wipe data other tests depend on
_DESTRUCTIVE_ACTIONS = {"/admin/trash/empty", "/admin/trash/{table}/{item_id}/permanent-delete"}
# Admin trash actions are excluded here — covered by TestAdminTrashLifecycle in test_business_logic.py
_ADMIN_TRASH_PATHS = {
"/admin/trash/empty",
"/admin/trash/{table}/{item_id}/permanent-delete",
"/admin/trash/{table}/{item_id}/restore",
}
_ACTION_ROUTES = [r for r in ALL_ROUTES if r.kind in (RouteKind.ACTION, RouteKind.TOGGLE) and r.path not in _ADMIN_TRASH_PATHS]
# ---------------------------------------------------------------------------
@@ -97,10 +100,6 @@ async def test_edit_redirects(client: AsyncClient, all_seeds: dict, route):
)
async def test_action_does_not_crash(client: AsyncClient, all_seeds: dict, route):
"""POST action routes should not return 500."""
# Skip destructive actions that would wipe seed data
if route.path in _DESTRUCTIVE_ACTIONS:
pytest.skip(f"Skipping destructive action {route.path}")
resolved = resolve_path(route.path, all_seeds)
if "{" in resolved:
pytest.skip(f"No seed data mapping for {route.path}")