the literal itself.
"""
+ global _CURRENT_LINE, _LAST_TAG_LINE
+ _CURRENT_LINE = 1
+ _LAST_TAG_LINE = None
# If the template is a file-like object then read it
try:
template = template.read()
self.assertRaises(chevron.ChevronError, chevron.render, **args)
+ def test_current_line_rest(self):
+ args = {
+ 'template': 'first line\nsecond line\n {{ foo } bar',
+ 'data': {'foo': 'xx'}
+ }
+
+ self.assertRaisesRegexp(chevron.ChevronError,
+ 'unclosed tag at line 3',
+ chevron.render, **args)
+ self.assertRaisesRegexp(chevron.ChevronError,
+ 'unclosed tag at line 3',
+ chevron.render, **args)
+ self.assertRaisesRegexp(chevron.ChevronError,
+ 'unclosed tag at line 3',
+ chevron.render, **args)
+
# Run unit tests from command line
if __name__ == "__main__":