Example #1
0
 def test_load_missing_template(self):
     engine = JsEngine(dirs=[settings.TEMPLATE_DIR])
     loader = JsLoader(engine)
     with self.assertRaises(TemplateDoesNotExist):
         loader.load_template_source('foo.js')
 def test_get_template(self):
     engine = JsEngine(dirs=[settings.TEMPLATE_DIR])
     template = engine.get_template('test-component.js')
     self.assertIsNotNone(template)
Example #3
0
 def test_empty_template_dir_config(self):
     engine = JsEngine()
     loader = JsLoader(engine)
     with self.assertRaises(TemplateDoesNotExist):
         loader.load_template_source('foo.js')
 def test_get_template_including_appdirs(self):
     engine = JsEngine(dirs=[settings.TEMPLATE_DIR], app_dirs=True)
     template = engine.get_template('test-component.js')
     self.assertIsNotNone(template)