Beispiel #1
0
 def test_registerTemplateRenderer_explicitrenderer(self):
     from pyramid import testing
     def renderer(kw, system):
         self.assertEqual(kw, {'foo':1, 'bar':2})
     renderer = testing.registerTemplateRenderer('templates/foo', renderer)
     from pyramid.renderers import render_to_response
     render_to_response('templates/foo', dict(foo=1, bar=2))
Beispiel #2
0
 def test_registerTemplateRenderer_explicitrenderer(self):
     from pyramid import testing
     def renderer(kw, system):
         self.assertEqual(kw, {'foo':1, 'bar':2})
     renderer = testing.registerTemplateRenderer('templates/foo', renderer)
     from pyramid.renderers import render_to_response
     render_to_response('templates/foo', dict(foo=1, bar=2))
Beispiel #3
0
 def test_registerTemplateRenderer(self):
     from pyramid import testing
     renderer = testing.registerTemplateRenderer('templates/foo')
     from pyramid.testing import DummyTemplateRenderer
     self.failUnless(isinstance(renderer, DummyTemplateRenderer))
     from pyramid.renderers import render_to_response
     render_to_response('templates/foo', dict(foo=1, bar=2))
     renderer.assert_(foo=1)
     renderer.assert_(bar=2)
Beispiel #4
0
 def test_registerTemplateRenderer(self):
     from pyramid import testing
     renderer = testing.registerTemplateRenderer('templates/foo')
     from pyramid.testing import DummyTemplateRenderer
     self.failUnless(isinstance(renderer, DummyTemplateRenderer))
     from pyramid.renderers import render_to_response
     render_to_response('templates/foo', dict(foo=1, bar=2))
     renderer.assert_(foo=1)
     renderer.assert_(bar=2)