Exemplo n.º 1
0
 def view(request, template_name):
     tmpl = Template("{{ test }}")
     return HttpResponse(tmpl.stream({"test": "success"}))
Exemplo n.º 2
0
 def test_stream(self):
     with self.settings(TEMPLATE_DEBUG=True):
         tmpl = Template("OK")
         tmpl.stream()
Exemplo n.º 3
0
    def test_stream_without_template_debug_setting(self):
        signals.template_rendered.connect(self._fail_listener)

        with self.settings(TEMPLATE_DEBUG=False):
            tmpl = Template("OK")
            tmpl.stream()
Exemplo n.º 4
0
 def test_render(self):
     with self.settings(TEMPLATE_DEBUG=True):
         tmpl = Template("OK")
         tmpl.render()
Exemplo n.º 5
0
 def view(request, template_name):
     tmpl = Template("{{ test }}")
     return HttpResponse(tmpl.stream({"test": "success"}))
Exemplo n.º 6
0
    def test_stream_without_template_debug_setting(self):
        signals.template_rendered.connect(self._fail_listener)

        with self.settings(TEMPLATE_DEBUG=False):
            tmpl = Template("OK")
            tmpl.stream()
Exemplo n.º 7
0
 def test_stream(self):
     with self.settings(TEMPLATE_DEBUG=True):
         tmpl = Template("OK")
         tmpl.stream()
Exemplo n.º 8
0
 def test_render(self):
     with self.settings(TEMPLATE_DEBUG=True):
         tmpl = Template("OK")
         tmpl.render()