aboutsummaryrefslogtreecommitdiff
path: root/tests/html_generation_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-14 15:08:26 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-14 15:08:26 +0000
commit14ca5c4d6993806b568ba5a9befb81326d9ed806 (patch)
tree8af24e08693787cc9d3e8de61ef377903fa5f420 /tests/html_generation_tests.py
parent75f454157737e34567a2325dc1c8fd7ca7b6e9a6 (diff)
Add attributes to start tags
Diffstat (limited to 'tests/html_generation_tests.py')
-rw-r--r--tests/html_generation_tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/html_generation_tests.py b/tests/html_generation_tests.py
index 9d1dc9a..fac6f05 100644
--- a/tests/html_generation_tests.py
+++ b/tests/html_generation_tests.py
@@ -64,3 +64,12 @@ def attribute_values_are_escaped():
generator = HtmlGenerator()
generator.self_closing("br", {"data-blah": "<"})
assert_equal('<br data-blah="&lt;" />', generator.html_string())
+
+
+@istest
+def opening_tag_can_have_attributes():
+ generator = HtmlGenerator()
+ generator.start("p", {"data-blah": "42"})
+ generator.text("Hello!")
+ generator.end()
+ assert_equal('<p data-blah="42">Hello!</p>', generator.html_string())