summaryrefslogtreecommitdiff
path: root/markupsafe/tests.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2013-05-21 17:39:57 +0100
committerArmin Ronacher <armin.ronacher@active-4.com>2013-05-21 17:39:57 +0100
commit94e9fcad7b310867421f6a3047e179ab4bb02d49 (patch)
tree9017d7ca8e092fb67222b7709ed579e736033035 /markupsafe/tests.py
parentda0309741522e9ce261a64609eb6c1479898f998 (diff)
downloadmarkupsafe-94e9fcad7b310867421f6a3047e179ab4bb02d49.tar.gz
Fixed interpolation on tuples
Diffstat (limited to 'markupsafe/tests.py')
-rw-r--r--markupsafe/tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/markupsafe/tests.py b/markupsafe/tests.py
index 12cd69b..a4c3571 100644
--- a/markupsafe/tests.py
+++ b/markupsafe/tests.py
@@ -44,6 +44,21 @@ class MarkupTestCase(unittest.TestCase):
assert Markup('<strong>%s</strong>') % Foo() == \
'<strong><em>awesome</em></strong>'
+ def test_tuple_interpol(self):
+ self.assertEqual(Markup('<em>%s:%s</em>') % (
+ '<foo>',
+ '<bar>',
+ ), Markup(u'<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
+
+ def test_dict_interpol(self):
+ self.assertEqual(Markup('<em>%(foo)s</em>') % {
+ 'foo': '<foo>',
+ }, Markup(u'<em>&lt;foo&gt;</em>'))
+ self.assertEqual(unicode(Markup('<em>%(foo)s:%(bar)s</em>') % {
+ 'foo': '<foo>',
+ 'bar': '<bar>',
+ }), unicode(Markup(u'<em>&lt;foo&gt;:&lt;bar&gt;</em>')))
+
def test_escaping(self):
# escaping and unescaping
assert escape('"<>&\'') == '&#34;&lt;&gt;&amp;&#39;'