summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakahiro Fujiwara <wutali.no@gmail.com>2013-02-18 23:56:22 +0900
committerTakahiro Fujiwara <wutali.no@gmail.com>2013-02-18 23:59:04 +0900
commiteeadb3a763fe2da39fbdc4c645ac786257b3bd73 (patch)
treea869b910ca29dbd36a42dbe4ba1a7672c807b513
parentdb388f453e3b4fe018fc3403722ff5ce50579080 (diff)
downloadpyramid-eeadb3a763fe2da39fbdc4c645ac786257b3bd73.tar.gz
pyramid-eeadb3a763fe2da39fbdc4c645ac786257b3bd73.tar.bz2
pyramid-eeadb3a763fe2da39fbdc4c645ac786257b3bd73.zip
Added a test case for templating with escaped double braces.
-rw-r--r--pyramid/tests/test_scaffolds/test_template.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/pyramid/tests/test_scaffolds/test_template.py b/pyramid/tests/test_scaffolds/test_template.py
index d7cf638b6..da6caffb9 100644
--- a/pyramid/tests/test_scaffolds/test_template.py
+++ b/pyramid/tests/test_scaffolds/test_template.py
@@ -11,7 +11,7 @@ class TestTemplate(unittest.TestCase):
inst = self._makeOne()
result = inst.render_template('{{a}} {{b}}', {'a':'1', 'b':'2'})
self.assertEqual(result, bytes_('1 2'))
-
+
def test_render_template_expr_failure(self):
inst = self._makeOne()
self.assertRaises(AttributeError, inst.render_template,
@@ -37,6 +37,11 @@ class TestTemplate(unittest.TestCase):
result = inst.render_template('{{a}}', {'a':None})
self.assertEqual(result, b'')
+ def test_render_template_with_escaped_double_quotes(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a}} {{b}} \{\{a\}\} \{\{c\}\}', {'a':'1', 'b':'2'})
+ self.assertEqual(result, bytes_('1 2 {{a}} {{c}}'))
+
def test_module_dir(self):
import sys
import pkg_resources
@@ -90,7 +95,7 @@ class TestTemplate(unittest.TestCase):
'overwrite':False,
'interactive':False,
})
-
+
def test_write_files_path_missing(self):
L = []
inst = self._makeOne()
@@ -132,9 +137,9 @@ class DummyOptions(object):
simulate = False
overwrite = False
interactive = False
-
+
class DummyCommand(object):
options = DummyOptions()
verbosity = 1
-
-
+
+