File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,15 @@ def test_interpolated_attribute_value_with_static_prefix_and_suffix():
506506 assert str (node ) == '<div data-id="item-3-suffix"></div>'
507507
508508
509+ def test_attribute_value_empty_string ():
510+ node = html (t '<div data-id=""></div>' )
511+ assert node == Element (
512+ "div" ,
513+ attrs = {"data-id" : "" },
514+ children = [],
515+ )
516+
517+
509518def test_interpolated_attribute_value_multiple_placeholders ():
510519 start = 1
511520 end = 5
@@ -518,6 +527,18 @@ def test_interpolated_attribute_value_multiple_placeholders():
518527 assert str (node ) == '<div data-range="1-5"></div>'
519528
520529
530+ def test_interpolated_attribute_value_tricky_multiple_placeholders ():
531+ start = "start"
532+ end = "end"
533+ node = html (t '<div data-range="{start}5-and-{end}12"></div>' )
534+ assert node == Element (
535+ "div" ,
536+ attrs = {"data-range" : "start5-and-end12" },
537+ children = [],
538+ )
539+ assert str (node ) == '<div data-range="start5-and-end12"></div>'
540+
541+
521542def test_interpolated_attribute_value_multiple_placeholders_no_quotes ():
522543 start = 1
523544 end = 5
You can’t perform that action at this time.
0 commit comments