def assert_loader_throws(self, exception_class, template, debug=False, **args): try: FileLoader(debug=debug).load_string(template) except exception_class: return raise AssertionError( 'loading the template {} did not throw a {}'.format( template, exception_class.__name__))
def get_loader(debug=False): rv = FileLoader(debug=debug) rv.add_path(os.path.join(data_dir, 'input')) return rv
def render(template, debug=False, **args): compiled = FileLoader(debug=debug).load_string(template) return text_type(compiled.render(args))
def render(template, debug=False, translatable=False, **args): compiled = FileLoader(debug=debug, translatable=translatable).load_string(template) return str(compiled.render(args))