fix: repair all test fixtures - add missing solution fields and fix httpx API

- Add missing `solution` field to solution-type nodes in test tree structures
  (required by `can_publish_tree` validation for published trees)
- Fix `AsyncClient(app=...)` → `ASGITransport(app=...)` in test_save_session_as_tree
  (httpx deprecated the `app` parameter in favor of transport)
- All 189 tests now pass (was 84 passed, 1 failed)

Files fixed: conftest.py, test_permissions_account.py, test_subscription_limits.py,
test_trees.py, test_save_session_as_tree.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-08 14:21:29 -05:00
parent b97596d286
commit a027e683e3
5 changed files with 25 additions and 16 deletions

View File

@@ -39,7 +39,7 @@ class TestAccountPermissions:
# Try to create tree
response = await client.post("/api/v1/trees", json={
"name": "Viewer Tree",
"tree_structure": {"id": "root", "type": "solution", "title": "Test", "description": "Test"}
"tree_structure": {"id": "root", "type": "solution", "title": "Test", "description": "Test", "solution": "Test solution"}
}, headers=viewer_headers)
assert response.status_code == 403
@@ -53,7 +53,7 @@ class TestAccountPermissions:
# Create a public tree as the regular user first
await client.post("/api/v1/trees", json={
"name": "Public Tree",
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T"},
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T", "solution": "Test solution"},
"is_public": True
}, headers=auth_headers)
@@ -119,7 +119,7 @@ class TestAccountPermissions:
# Engineer creates a tree
tree_resp = await client.post("/api/v1/trees", json={
"name": "Engineer's Tree",
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T"}
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T", "solution": "Test solution"}
}, headers=eng_headers)
assert tree_resp.status_code == 201
tree_id = tree_resp.json()["id"]
@@ -143,7 +143,7 @@ class TestAccountPermissions:
# Owner creates a private tree
tree_resp = await client.post("/api/v1/trees", json={
"name": "Private Account Tree",
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T"},
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T", "solution": "Test solution"},
"is_public": False
}, headers=auth_headers)
assert tree_resp.status_code == 201
@@ -181,7 +181,7 @@ class TestAccountPermissions:
# Owner creates a private tree
tree_resp = await client.post("/api/v1/trees", json={
"name": "Secret Tree",
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T"},
"tree_structure": {"id": "root", "type": "solution", "title": "T", "description": "T", "solution": "Test solution"},
"is_public": False
}, headers=auth_headers)
assert tree_resp.status_code == 201