async def test_trigger_sync_user_not_found(self, mock_sync_with_schedule):
        """Test triggering a sync with a user that doesn't exist."""
        scheduler = PlatformScheduler()
        mock_db = AsyncMock()

        # Mock user not found
        with patch(
            "airweave.platform.scheduler.crud.user.get_by_email",
            new_callable=AsyncMock,
            return_value=None,
        ):
            # Execute method
            await scheduler._trigger_sync(mock_db, mock_sync_with_schedule)

            # Assert user lookup was attempted
            crud.user.get_by_email.assert_called_once()
Test triggering a sync with a user that doesn't exist.
backend/tests/unit/platform/test_scheduler.py