Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test(api): use unbound session in app generate tests (#45130)

lj1166b543ff5abe83
diff --git a/api/tests/unit_tests/services/test_app_generate_service.py b/api/tests/unit_tests/services/test_app_generate_service.py
index 7c1795857a9..12f51af15c8 100644
--- a/api/tests/unit_tests/services/test_app_generate_service.py
+++ b/api/tests/unit_tests/services/test_app_generate_service.py
@@ -556,7 +556,7 @@ class TestAppGenerateServiceCases:
args={"inputs": {}},
invoke_from=invoke_from,
streaming=False,
- session=MagicMock(),
+ session=self.session,
)
generate.assert_not_called()
@@ -579,7 +579,7 @@ class TestAppGenerateServiceCases:
args={"inputs": {}},
invoke_from=InvokeFrom.TRIGGER,
streaming=False,
- session=MagicMock(),
+ session=self.session,
)
assert result == {"result": "trigger"}
@@ -598,7 +598,7 @@ class TestAppGenerateServiceCases:
side_effect=lambda value: value,
)
app = _make_app(AppMode.WORKFLOW)
- session = MagicMock()
+ session = self.session
result = AppGenerateService.generate(
app_model=app,