def test_render():
 t = Jinja2Template(JINJA2.path)
 t.configure(None)
 t.env.filters['dateformat'] = dateformat
 source = File(JINJA2.child('index.html')).read_all()
 html = t.render(source, context)
 actual = PyQuery(html)
 assert (actual('.navigation li').length == 30)
 assert (actual('div.article').length == 20)
 assert (actual('div.article h2').length == 20)
 assert (actual('div.article h2 a').length == 20)
 assert (actual('div.article p.meta').length == 20)
 assert (actual('div.article div.text').length == 20)

def test_render ( ) : t = Jinja2Template ( JINJA2 . path ) t . configure ( None ) t . env . filters [ 'dateformat' ] = dateformat source = File ( JINJA2 . child ( 'index.html' ) ) . read_all ( ) html = t . render ( source , context ) actual = PyQuery ( html ) assert ( actual ( '.navigation li' ) . length == 30 ) assert ( actual ( 'div.article' ) . length == 20 ) assert ( actual ( 'div.article h2' ) . length == 20 ) assert ( actual ( 'div.article h2 a' ) . length == 20 ) assert ( actual ( 'div.article p.meta' ) . length == 20 ) assert ( actual ( 'div.article div.text' ) . length == 20 )
uses pyquery to test the html structure for validity .