def test_custom_rendering():
 countries = CountryTable(MEMORY_DATA)
 context = Context({u'countries': countries})
 template = Template(u'{% for column in countries.columns %}{{ column }}/{{ column.name }} {% endfor %}')
 result = u'Name/name Capital/capital Population Size/population Phone Ext./calling_code '
 assert (result == template.render(context))
 template = Template(u'{% for row in countries.rows %}{% for value in row %}{{ value }} {% endfor %}{% endfor %}')
 result = u'Germany Berlin 83 49 France \u2014 64 33 Netherlands Amsterdam \u2014 31 Austria \u2014 8 43 '
 assert (result == template.render(context))

def test_custom_rendering ( ) : countries = CountryTable ( MEMORY_DATA ) context = Context ( { u'countries' : countries } ) template = Template ( u'{% for column in countries.columns %}{{ column }}/{{ column.name }} {% endfor %}' ) result = u'Name/name Capital/capital Population Size/population Phone Ext./calling_code ' assert ( result == template . render ( context ) ) template = Template ( u'{% for row in countries.rows %}{% for value in row %}{{ value }} {% endfor %}{% endfor %}' ) result = u'Germany Berlin 83 49 France \u2014 64 33 Netherlands Amsterdam \u2014 31 Austria \u2014 8 43 ' assert ( result == template . render ( context ) )
for good measure .