def test_engine_func(self): def engine(data, template=None): return 'text/plain', data render = Engines() render['raw'] = engine self.assertEqual(render.raw("foo"), ('text/plain', 'foo')) del render.raw
def test_engine_class(self): class Engine(object): def __call__(self, data, template=None): return 'text/plain', data render = Engines() render['raw'] = Engine self.assertEqual(render.raw("foo"), ('text/plain', 'foo')) del render.raw