mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 16:38:04 +08:00
refactor(api): Remove unused method
This commit is contained in:
@ -80,10 +80,6 @@ class EmailDeliveryConfig(BaseModel):
|
||||
"""Replace the url placeholder with provided value."""
|
||||
return body.replace(cls.URL_PLACEHOLDER, url or "")
|
||||
|
||||
def body_with_url(self, url: str | None) -> str:
|
||||
"""Return body content with url placeholder replaced."""
|
||||
return self.render_body_template(body=self.body, url=url)
|
||||
|
||||
@classmethod
|
||||
def render_body_template(
|
||||
cls,
|
||||
|
||||
@ -4,7 +4,7 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
import core.app.apps.common.workflow_response_converter as workflow_response_converter
|
||||
from core.app.apps.common import workflow_response_converter
|
||||
from core.app.apps.common.workflow_response_converter import WorkflowResponseConverter
|
||||
from core.app.apps.workflow.app_runner import WorkflowAppRunner
|
||||
from core.app.entities.app_invoke_entities import InvokeFrom
|
||||
|
||||
@ -2,30 +2,6 @@ from core.workflow.nodes.human_input.entities import EmailDeliveryConfig, EmailR
|
||||
from core.workflow.runtime import VariablePool
|
||||
|
||||
|
||||
def test_replace_url_placeholder_with_value():
|
||||
config = EmailDeliveryConfig(
|
||||
recipients=EmailRecipients(),
|
||||
subject="Subject",
|
||||
body="Click here {{#url#}} to open.",
|
||||
)
|
||||
|
||||
result = config.body_with_url("https://example.com/link")
|
||||
|
||||
assert result == "Click here https://example.com/link to open."
|
||||
|
||||
|
||||
def test_replace_url_placeholder_missing_value():
|
||||
config = EmailDeliveryConfig(
|
||||
recipients=EmailRecipients(),
|
||||
subject="Subject",
|
||||
body="No link {{#url#}} available.",
|
||||
)
|
||||
|
||||
result = config.body_with_url(None)
|
||||
|
||||
assert result == "No link available."
|
||||
|
||||
|
||||
def test_render_body_template_replaces_variable_values():
|
||||
config = EmailDeliveryConfig(
|
||||
recipients=EmailRecipients(),
|
||||
|
||||
Reference in New Issue
Block a user