#NEWLINE# def test_template_context( test_app , test_pilot ) : #NEWLINE# #INDENT# 'Test that the template context gets injected properly.' #NEWLINE# test_pilot . init_app ( test_app ) #NEWLINE# @ test_app . route ( '/' , navbar_kwargs = { #NEWLINE# #INDENT# 'path' : ( 'Home' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def index( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# template_string = '\n        {% for entry in navbar %}\n            <a href="{{ entry.url() }}">{{ entry.name }}</a>\n        {% endfor %}\n    ' #NEWLINE# with test_app . test_request_context ( '/' ) : #NEWLINE# #INDENT# rendered = render_template_string ( template_string ) #NEWLINE# #UNINDENT# expected = '<a href="/">Home</a>' #NEWLINE# assert ( rendered . strip ( ) == expected )