1
0
forked from erp-dev/erp
Files
erpnew/printing/test_wecom_markdown.py

24 lines
899 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)