コード例 #1
0
    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()
コード例 #2
0
ファイル: test_filters.py プロジェクト: Rafails/MyCalc
    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()
コード例 #3
0
ファイル: test_filters.py プロジェクト: Rafails/MyCalc
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)
コード例 #4
0
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)