comparison genshi/template/tests/text.py @ 629:cae74e2637c6

Revert second part of [726] (error on includes when no loader specified), which broke I18n extraction via the Babel plugin.
author cmlenz
date Tue, 04 Sep 2007 11:51:58 +0000
parents 6a37018199fd
children fa8a55fe2d57
comparison
equal deleted inserted replaced
628:693a7212b348 629:cae74e2637c6
110 self.assertEqual("""----- Included data below this line ----- 110 self.assertEqual("""----- Included data below this line -----
111 Included 111 Included
112 ----- Included data above this line -----""", 112 ----- Included data above this line -----""",
113 tmpl.generate().render()) 113 tmpl.generate().render())
114 114
115 def test_include_without_loader(self):
116 text = '#include "oops.html"'
117 self.assertRaises(TemplateSyntaxError, OldTextTemplate, text)
118
119 115
120 class NewTextTemplateTestCase(unittest.TestCase): 116 class NewTextTemplateTestCase(unittest.TestCase):
121 """Tests for text template processing.""" 117 """Tests for text template processing."""
122 118
123 def setUp(self): 119 def setUp(self):
234 tmpl = loader.load('tmpl2.txt', cls=NewTextTemplate) 230 tmpl = loader.load('tmpl2.txt', cls=NewTextTemplate)
235 self.assertEqual("""----- Included data below this line ----- 231 self.assertEqual("""----- Included data below this line -----
236 Included 232 Included
237 ----- Included data above this line -----""", tmpl.generate().render()) 233 ----- Included data above this line -----""", tmpl.generate().render())
238 234
239 def test_include_without_loader(self):
240 text = '{% include "oops.html" %}'
241 self.assertRaises(TemplateSyntaxError, NewTextTemplate, text)
242
243 235
244 def suite(): 236 def suite():
245 suite = unittest.TestSuite() 237 suite = unittest.TestSuite()
246 suite.addTest(doctest.DocTestSuite(NewTextTemplate.__module__)) 238 suite.addTest(doctest.DocTestSuite(NewTextTemplate.__module__))
247 suite.addTest(unittest.makeSuite(OldTextTemplateTestCase, 'test')) 239 suite.addTest(unittest.makeSuite(OldTextTemplateTestCase, 'test'))
Copyright (C) 2012-2017 Edgewall Software