Пример #1
0
    def test_nested_context(self):
        renderer = Renderer()
        view = NestedContext(renderer)
        view.template = '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}'

        actual = renderer.render(view)
        self.assertString(actual, u"one and foo and two")
Пример #2
0
    def test_nested_context(self):
        renderer = Renderer()
        view = NestedContext(renderer)
        view.template = '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}'

        actual = renderer.render(view)
        self.assertString(actual, u"one and foo and two")
Пример #3
0
    def test_nested_context_is_available_in_view(self):
        renderer = Renderer()

        view = NestedContext(renderer)
        view.template = "{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}"

        actual = renderer.render(view)
        self.assertString(actual, u"it works!")
Пример #4
0
    def test_nested_context_is_available_in_view(self):
        renderer = Renderer()

        view = NestedContext(renderer)
        view.template = '{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}'

        actual = renderer.render(view)
        self.assertString(actual, u'it works!')
Пример #5
0
 def test_nested_context_is_available_in_view(self):
     view = NestedContext()
     view.template = '{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}'
     self.assertEquals(view.render(), 'it works!')
Пример #6
0
 def test_nested_context(self):
     self.assertEquals(NestedContext().render(), "one and foo and two")
Пример #7
0
 def test_nested_context_is_available_in_view(self):
     view = NestedContext()
     view.template = "{{#herp}}{{#derp}}{{nested_context_in_view}}{{/derp}}{{/herp}}"
     self.assertEquals(view.render(), "it works!")
Пример #8
0
 def test_nested_context(self):
     view = NestedContext()
     view.template = '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}'
     self.assertEquals(view.render(), "one and foo and two")
Пример #9
0
 def test_nested_context(self):
     view = NestedContext()
     self.assertEquals(
         pystache.Template(
             '{{#foo}}{{thing1}} and {{thing2}} and {{outer_thing}}{{/foo}}{{^foo}}Not foo!{{/foo}}',
             view).render(), "one and foo and two")
Пример #10
0
 def test_nested_context(self):
     renderer = Renderer()
     actual = renderer.render(NestedContext(renderer))
     self.assertString(actual, u"one and foo and two")