aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-14 15:04:13 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-14 15:04:13 +0000
commit75f454157737e34567a2325dc1c8fd7ca7b6e9a6 (patch)
tree36eea15618567f4cb700be9d257e7d5cfa001fc5 /tests
parentc1eb161cc9d4b8e41d85643ba7b090f2f2d95471 (diff)
Escape attribute values
Diffstat (limited to 'tests')
-rw-r--r--tests/html_generation_tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/html_generation_tests.py b/tests/html_generation_tests.py
index c637798..9d1dc9a 100644
--- a/tests/html_generation_tests.py
+++ b/tests/html_generation_tests.py
@@ -57,3 +57,10 @@ def self_closing_tag_can_have_attributes():
generator = HtmlGenerator()
generator.self_closing("br", {"data-blah": "42"})
assert_equal('<br data-blah="42" />', generator.html_string())
+
+
+@istest
+def attribute_values_are_escaped():
+ generator = HtmlGenerator()
+ generator.self_closing("br", {"data-blah": "<"})
+ assert_equal('<br data-blah="&lt;" />', generator.html_string())