fix: merge main branch and renumber migration 027→037
Resolve 3 merge conflicts and renumber the automation_hooks migration to follow main's migration chain (036_add_document_translation_fields). Conflicts resolved: - app/api/__init__.py: add automation_router alongside main's new routers - app/utils/settings_service.py: add automation_hooks_enabled alongside compliance_enabled - tests/conftest.py: add AutomationHook alongside AuditLog/ComplianceTemplate imports Migration renumbered: - 027_add_automation_hooks → 037_add_automation_hooks - down_revision: 026_add_scheduled_jobs → 036_add_document_translation_fields Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -116,9 +116,13 @@ class TestProtectedAPIEndpoints:
|
||||
}
|
||||
}
|
||||
|
||||
# Mock DB: no UserProfile found (no custom avatar)
|
||||
mock_db = MagicMock()
|
||||
mock_db.query.return_value.filter.return_value.first.return_value = None
|
||||
|
||||
import asyncio
|
||||
|
||||
result = asyncio.run(whoami_handler(mock_request))
|
||||
result = asyncio.run(whoami_handler(mock_request, mock_db))
|
||||
|
||||
assert result["id"] == "test123"
|
||||
assert result["email"] == "test@example.com"
|
||||
@@ -135,9 +139,10 @@ class TestProtectedAPIEndpoints:
|
||||
|
||||
mock_request = MagicMock()
|
||||
mock_request.session = {}
|
||||
mock_db = MagicMock()
|
||||
|
||||
with pytest.raises(HTTPException) as exc_info:
|
||||
asyncio.run(whoami_handler(mock_request))
|
||||
asyncio.run(whoami_handler(mock_request, mock_db))
|
||||
|
||||
assert exc_info.value.status_code == 401
|
||||
assert "Not logged in" in exc_info.value.detail
|
||||
|
||||
Reference in New Issue
Block a user