示例#1
0
  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)
示例#2
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)
示例#3
0
  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)