MCPcopy
hub / github.com/python-visualization/folium / test_popup_backticks

Function test_popup_backticks

tests/test_map.py:218–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216
217
218def test_popup_backticks():
219 m = Map()
220 popup = Popup("back`tick`tick").add_to(m)
221 rendered = popup._template.render(this=popup, kwargs={})
222 expected = """
223 var {popup_name} = L.popup({{
224 "maxWidth": "100%",
225 }});
226 var {html_name} = $(`<div id="{html_name}" style="width: 100.0%; height: 100.0%;">back\\`tick\\`tick</div>`)[0];
227 {popup_name}.setContent({html_name});
228 {map_name}.bindPopup({popup_name});
229 """.format(
230 popup_name=popup.get_name(),
231 html_name=list(popup.html._children.keys())[0],
232 map_name=m.get_name(),
233 )
234 assert normalize(rendered) == normalize(expected)
235
236
237def test_popup_backticks_already_escaped():

Callers

nothing calls this directly

Calls 5

MapClass · 0.90
PopupClass · 0.90
normalizeFunction · 0.90
add_toMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected