def test_resource_url():
 data = jinja.render('test2.html')
 print data
 url = QUrl(data)
 assert url.isValid()
 assert (url.scheme() == 'file')
 path = url.path()
 if (os.name == 'nt'):
  path = path.lstrip('/')
  path = path.replace('/', os.sep)
 with open(path, 'r', encoding='utf-8') as f:
  assert (f.read().splitlines()[0] == 'Hello World!')

def test_resource_url ( ) : data = jinja . render ( 'test2.html' ) print data url = QUrl ( data ) assert url . isValid ( ) assert ( url . scheme ( ) == 'file' ) path = url . path ( ) if ( os . name == 'nt' ) : path = path . lstrip ( '/' ) path = path . replace ( '/' , os . sep ) with open ( path , 'r' , encoding = 'utf-8' ) as f : assert ( f . read ( ) . splitlines ( ) [ 0 ] == 'Hello World!' )
test resource_url() which can be used from templates .