feat(libs): Introduce extract_tenant_id (#22086)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN-
2025-07-09 17:45:56 +08:00
committed by GitHub
parent 1885426421
commit 4cb50f1809
8 changed files with 106 additions and 27 deletions

View File

@@ -9,6 +9,7 @@ from core.file.models import File
from core.variables import FloatVariable, IntegerVariable, SecretVariable, StringVariable
from core.variables.segments import IntegerSegment, Segment
from factories.variable_factory import build_segment
from models.model import EndUser
from models.workflow import Workflow, WorkflowDraftVariable, WorkflowNodeExecutionModel, is_system_variable_editable
@@ -43,7 +44,7 @@ def test_environment_variables():
)
# Mock current_user as an EndUser
mock_user = mock.Mock()
mock_user = mock.Mock(spec=EndUser)
mock_user.tenant_id = "tenant_id"
with (
@@ -90,7 +91,7 @@ def test_update_environment_variables():
)
# Mock current_user as an EndUser
mock_user = mock.Mock()
mock_user = mock.Mock(spec=EndUser)
mock_user.tenant_id = "tenant_id"
with (
@@ -136,7 +137,7 @@ def test_to_dict():
# Create some EnvironmentVariable instances
# Mock current_user as an EndUser
mock_user = mock.Mock()
mock_user = mock.Mock(spec=EndUser)
mock_user.tenant_id = "tenant_id"
with (