Exemplo n.º 1
0
 def render_template(self, model, template_name):
     """
     Open template file, replace placeholders with data from model
     """
     template_path = os.path.join(self.test_dir, 'templates/' + template_name + '.html')
     with io.open(template_path) as template:
         template_name = template.read()
         return render(model, template_name)
Exemplo n.º 2
0
 def test_render(self):
     rendered_string = "Hello World. 1234"
     self.assertEqual(rendered_string, render(self.data, self.template))
     pass