diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2013-05-21 17:39:57 +0100 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2013-05-21 17:39:57 +0100 |
commit | 94e9fcad7b310867421f6a3047e179ab4bb02d49 (patch) | |
tree | 9017d7ca8e092fb67222b7709ed579e736033035 /markupsafe/tests.py | |
parent | da0309741522e9ce261a64609eb6c1479898f998 (diff) | |
download | markupsafe-94e9fcad7b310867421f6a3047e179ab4bb02d49.tar.gz |
Fixed interpolation on tuples
Diffstat (limited to 'markupsafe/tests.py')
-rw-r--r-- | markupsafe/tests.py | 15 |
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><foo>:<bar></em>')) + + def test_dict_interpol(self): + self.assertEqual(Markup('<em>%(foo)s</em>') % { + 'foo': '<foo>', + }, Markup(u'<em><foo></em>')) + self.assertEqual(unicode(Markup('<em>%(foo)s:%(bar)s</em>') % { + 'foo': '<foo>', + 'bar': '<bar>', + }), unicode(Markup(u'<em><foo>:<bar></em>'))) + def test_escaping(self): # escaping and unescaping assert escape('"<>&\'') == '"<>&'' |