def setUp(self): self.request = testing.DummyRequest() self.config = testing.setUp(request=self.request) self.request.registry = self.config.registry from pyramid_jinja2 import Environment self.environment = Environment() self._addFilters()
class Base(object): def setUp(self): self.request = testing.DummyRequest() self.config = testing.setUp(request=self.request) self.request.registry = self.config.registry from pyramid_jinja2 import Environment self.environment = Environment() self._addFilters() def tearDown(self): testing.tearDown() def _addFilters(self): pass def _callFUT(self, context, tmpl): tmpl = self.environment.from_string(tmpl) return tmpl.render(**context)