File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,24 @@ def test_tag_use_in_template(version, template_code):
3636 )
3737
3838
39+ @override_settings (MERMAID_USE_CDN = True )
40+ @pytest .mark .parametrize (
41+ "template_code" ,
42+ [
43+ "{% load mermaid %}{% mermaid content %}" ,
44+ "{% load mermaid %}{% startmermaid %}{{ content|safe }}{% endmermaid %}"
45+ ]
46+ )
47+ def test_tag_use_mermaid_cdn (version , template_code ):
48+ template = Template (template_code )
49+ template = template .render (Context ({"content" : "graph LR; A-->B;" }))
50+ assert template == (
51+ "<div class=\" mermaid\" >graph LR; A-->B;</div><script src=\" https://cdnjs.cloudflare.com/ajax/libs/mermaid/%s/mermaid.min.js\" ></script>"
52+ "<script>mermaid.initialize({\" startOnLoad\" : true, \" theme\" : \" default\" , \" themeVariables\" "
53+ ": {}});</script>" % version
54+ )
55+
56+
3957@override_settings (MERMAID_THEME = "forest" )
4058@pytest .mark .parametrize (
4159 "template_code" ,
You can’t perform that action at this time.
0 commit comments