diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index e40acb29..a1d0221d 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -174,13 +174,15 @@ async def test_tree(client, auth_headers): "id": "solution1", "type": "solution", "title": "Test Confirmed", - "description": "This is a test tree" + "description": "This is a test tree", + "solution": "Test confirmed - this is a test tree" }, { "id": "solution2", "type": "solution", "title": "Not a Test", - "description": "This should not happen" + "description": "This should not happen", + "solution": "Not a test - this should not happen" } ] } diff --git a/backend/tests/test_permissions_account.py b/backend/tests/test_permissions_account.py index 211a7340..a18067a9 100644 --- a/backend/tests/test_permissions_account.py +++ b/backend/tests/test_permissions_account.py @@ -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 diff --git a/backend/tests/test_save_session_as_tree.py b/backend/tests/test_save_session_as_tree.py index 18dc759c..f60eee8f 100644 --- a/backend/tests/test_save_session_as_tree.py +++ b/backend/tests/test_save_session_as_tree.py @@ -362,8 +362,8 @@ class TestSaveSessionAsTreeAPI: await test_db.refresh(session) # Try to save the session as test_user (should fail - filtered by user_id) - from httpx import AsyncClient - async with AsyncClient(app=client._transport.app, base_url="http://test") as test_client: # type: ignore + from httpx import AsyncClient, ASGITransport + async with AsyncClient(transport=ASGITransport(app=client._transport.app), base_url="http://test") as test_client: # type: ignore # Login as test_user login_response = await test_client.post( "/api/v1/auth/login", diff --git a/backend/tests/test_subscription_limits.py b/backend/tests/test_subscription_limits.py index 540e42af..6f07266f 100644 --- a/backend/tests/test_subscription_limits.py +++ b/backend/tests/test_subscription_limits.py @@ -18,7 +18,8 @@ class TestSubscriptionLimits: "id": "root", "type": "solution", "title": "Test", - "description": "Test tree" + "description": "Test tree", + "solution": "Test solution" } } @@ -50,7 +51,8 @@ class TestSubscriptionLimits: "id": "root", "type": "solution", "title": "Test", - "description": "Test" + "description": "Test", + "solution": "Test solution" } } create_resp = await client.post("/api/v1/trees", json=tree_data, headers=auth_headers) @@ -73,7 +75,8 @@ class TestSubscriptionLimits: "id": "root", "type": "solution", "title": "Test", - "description": "Test tree" + "description": "Test tree", + "solution": "Test solution" }, "is_default": True # Default trees skip limit check } diff --git a/backend/tests/test_trees.py b/backend/tests/test_trees.py index 266ed039..79347246 100644 --- a/backend/tests/test_trees.py +++ b/backend/tests/test_trees.py @@ -38,7 +38,8 @@ class TestTrees: "id": "check_cable", "type": "solution", "title": "Check Network Cable", - "description": "Verify the network cable is connected" + "description": "Verify the network cable is connected", + "solution": "Check and reseat the network cable" } ] } @@ -189,7 +190,8 @@ class TestTrees: "id": "root", "type": "solution", "title": "Private", - "description": "Private tree" + "description": "Private tree", + "solution": "Private solution" }, "is_public": False, "is_default": False @@ -220,7 +222,8 @@ class TestTrees: "id": "root", "type": "solution", "title": "Test", - "description": "Test tree" + "description": "Test tree", + "solution": "Test solution" } } create_resp = await client.post("/api/v1/trees", json=tree_data, headers=auth_headers) @@ -337,7 +340,8 @@ class TestTrees: "id": "root", "type": "solution", "title": "Test", - "description": "Test tree" + "description": "Test tree", + "solution": "Test solution" } response = await client.post("/api/v1/trees", json=tree_data, headers=auth_headers) assert response.status_code == 201