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):
36
36
)
37
37
38
38
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
+
39
57
@override_settings (MERMAID_THEME = "forest" )
40
58
@pytest .mark .parametrize (
41
59
"template_code" ,
You can’t perform that action at this time.
0 commit comments