1
0
forked from erp-dev/erp

feat: wecomm support image link

This commit is contained in:
2026-01-23 21:11:13 +08:00
parent 81640cb84b
commit 4d33bc7f68
4 changed files with 99 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
from django.test import SimpleTestCase
class WeComMarkdownRenderTest(SimpleTestCase):
def test_render_process_params_markdown_linkify_http_url(self):
from printing.services import render_process_params_markdown
md = render_process_params_markdown(
params={
"图片": "https://example.com/a.png",
"备注": "不是链接",
}
)
self.assertIn("- **图片**[https://example.com/a.png](https://example.com/a.png)", md)
self.assertIn("- **备注**:不是链接", md)
def test_render_process_params_markdown_linkify_strips_whitespace(self):
from printing.services import render_process_params_markdown
md = render_process_params_markdown(params={"图片": " https://example.com/a.png "})
self.assertIn("[https://example.com/a.png](https://example.com/a.png)", md)