#NEWLINE# def test_dynamic_inheritance( self , env ) : #NEWLINE# #INDENT# env = Environment ( loader = DictLoader ( { #NEWLINE# #INDENT# 'master1' : 'MASTER1{% block x %}{% endblock %}' , #NEWLINE# 'master2' : 'MASTER2{% block x %}{% endblock %}' , #NEWLINE# 'child' : '{% extends master %}{% block x %}CHILD{% endblock %}' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# tmpl = env . get_template ( 'child' ) #NEWLINE# for m in range ( 1 , 3 ) : #NEWLINE# #INDENT# assert ( tmpl . render ( master = ( 'master%d' % m ) ) == ( 'MASTER%dCHILD' % m ) )