def test_add_context_kw(self): e = EnvironmentWrapper(MockEnvironment()) t = e.get_template("hsr/login.html", "parent", "globals") e.add_context_variables(b=1, c=2) assert "render" == t.render(a=0)
def test_add_context_overwrite(self): e = EnvironmentWrapper(MockEnvironment()) t = e.get_template("hsr/login.html", "parent", "globals") e.add_context_variables({'b' : 5, 'c' : 2}) assert "render" == t.render(a=0, b=1)
def __call__(self, environ, start_response): environ['pythia'] = { 'jinja_env': EnvironmentWrapper(self.jinja_env), 'app_settings': self.settings, } pipeline = Pipeline(self.chain) return pipeline(environ, CustomStartResponse(start_response))
def test_simple(self): e = EnvironmentWrapper(MockEnvironment()) t = e.get_template("hsr/login.html", "parent", "globals") assert "render" == t.render(a=0, b=1, c=2)