forked from orbit-oss/flask
Allow loading template from iterable
This commit is contained in:
parent
04bb720d38
commit
0b3369355d
2 changed files with 24 additions and 3 deletions
|
|
@ -178,6 +178,25 @@ class TemplatingTestCase(FlaskTestCase):
|
|||
self.assert_equal(rv.data, 'Hello Custom World!')
|
||||
|
||||
|
||||
def test_iterable_loader(self):
|
||||
app = flask.Flask(__name__)
|
||||
@app.context_processor
|
||||
def context_processor():
|
||||
return {'whiskey': 'Jameson'}
|
||||
@app.route('/')
|
||||
def index():
|
||||
return flask.render_template(
|
||||
['no_template.xml', # should skip this one
|
||||
'simple_template.html', # should render this
|
||||
'context_template.html'],
|
||||
value=23)
|
||||
|
||||
rv = app.test_client().get('/')
|
||||
self.assert_equal(rv.data, '<h1>Jameson</h1>')
|
||||
|
||||
|
||||
|
||||
|
||||
def suite():
|
||||
suite = unittest.TestSuite()
|
||||
suite.addTest(unittest.makeSuite(TemplatingTestCase))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue