wip(handoff): restore backend suite to green
Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
@@ -4,6 +4,7 @@ from datetime import datetime, timezone, timedelta
|
||||
from httpx import AsyncClient
|
||||
from uuid import uuid4
|
||||
|
||||
from app.models.account import Account
|
||||
from app.models.tree import Tree
|
||||
from app.models.tree_share import TreeShare
|
||||
from app.models.user import User
|
||||
@@ -287,13 +288,17 @@ class TestTreeSharing:
|
||||
@pytest.mark.asyncio
|
||||
async def test_migration_defaults_visibility_to_team(test_db):
|
||||
"""Test that existing trees default to 'team' visibility after migration."""
|
||||
account = Account(name="Migration Default Test", display_code=uuid4().hex[:8])
|
||||
test_db.add(account)
|
||||
await test_db.flush()
|
||||
|
||||
# Create a tree without specifying visibility
|
||||
tree = Tree(
|
||||
name="Old Tree",
|
||||
description="Created before migration",
|
||||
tree_structure={"id": "root", "type": "decision", "question": "Test?", "children": []},
|
||||
author_id=None,
|
||||
account_id=None
|
||||
account_id=account.id
|
||||
)
|
||||
test_db.add(tree)
|
||||
await test_db.commit()
|
||||
|
||||
Reference in New Issue
Block a user