@@ -103,7 +103,6 @@ def test_init(self):
103
103
assert self .m .width == (900 , 'px' )
104
104
assert self .m .left == (0 , '%' )
105
105
assert self .m .top == (0 , '%' )
106
- assert self .m .global_switches .prefer_canvas is False
107
106
assert self .m .global_switches .no_touch is False
108
107
assert self .m .global_switches .disable_3d is False
109
108
assert self .m .to_dict () == {
@@ -278,7 +277,7 @@ def test_fit_bounds(self):
278
277
'padding' : (3 , 3 ), },
279
278
sort_keys = True ),
280
279
'this' : fitbounds ,
281
- })
280
+ })
282
281
283
282
assert '' .join (fit_bounds_rendered .split ()) in '' .join (out .split ())
284
283
@@ -310,22 +309,30 @@ def test_custom_icon(self):
310
309
311
310
def test_global_switches (self ):
312
311
m = folium .Map (prefer_canvas = True )
313
- assert m .global_switches .prefer_canvas
312
+ out = m ._parent .render ()
313
+ out_str = '' .join (out .split ())
314
+ assert "preferCanvas:true" in out_str
314
315
assert not m .global_switches .no_touch
315
316
assert not m .global_switches .disable_3d
316
317
317
318
m = folium .Map (no_touch = True )
318
- assert not m .global_switches .prefer_canvas
319
+ out = m ._parent .render ()
320
+ out_str = '' .join (out .split ())
321
+ assert "preferCanvas:false" in out_str
319
322
assert m .global_switches .no_touch
320
323
assert not m .global_switches .disable_3d
321
324
322
325
m = folium .Map (disable_3d = True )
323
- assert not m .global_switches .prefer_canvas
326
+ out = m ._parent .render ()
327
+ out_str = '' .join (out .split ())
328
+ assert "preferCanvas:false" in out_str
324
329
assert not m .global_switches .no_touch
325
330
assert m .global_switches .disable_3d
326
331
327
332
m = folium .Map (prefer_canvas = True , no_touch = True , disable_3d = True )
328
- assert m .global_switches .prefer_canvas
333
+ out = m ._parent .render ()
334
+ out_str = '' .join (out .split ())
335
+ assert "preferCanvas:true" in out_str
329
336
assert m .global_switches .no_touch
330
337
assert m .global_switches .disable_3d
331
338
0 commit comments