def test_stacks_template():
    """test stacks in template"""
    params = dict(
        title=my_name(),
        message='hello, from breve'
    )
    t = Template(html, root=template_root())
    actual = t.render('index', params, namespace='v')
    expected = expected_output()
    assert actual == expected
    # stack should be empty when we finish
    assert not get_stacks()
Exemple #2
0
    def test_stacks_template(self):
        '''test stacks in template'''

        vars = dict(title=my_name(), message='hello, from breve')
        t = Template(html, root=template_root())
        actual = t.render('index', vars, namespace='v')
        expected = expected_output()

        try:
            self.assertEqual(actual, expected)
        except AssertionError:
            diff(actual, expected)
            raise

        # stack should be empty when we finish
        self.failUnless(not get_stacks())
Exemple #3
0
    def test_stacks_template ( self ):
        '''test stacks in template'''
        
        vars = dict ( 
            title = my_name ( ),
            message = 'hello, from breve'
        )
        t = Template ( html, root = template_root ( ) )
        actual = t.render ( 'index', vars, namespace = 'v' )
        expected = expected_output ( )

        try:
            self.assertEqual ( actual, expected )
        except AssertionError:
            diff ( actual, expected )
            raise

        # stack should be empty when we finish
        self.failUnless ( not get_stacks ( ) )