<s> from djangosanetesting . cases import TemplateTagTestCase <EOL> class TestTagLib ( TemplateTagTestCase ) : <EOL> preload = ( '<STR_LIT>' , ) <EOL> def test_tag_error ( self ) : <EOL> self . assert_raises ( self . TemplateSyntaxError , self . render_template , <EOL> '<STR_LIT>' ) <EOL> def test_tag_output ( self ) : <EOL> self . assert_equal ( self . render_template ( '<STR_LIT>' ) , <EOL> u'<STR_LIT>' ) <EOL> class TestFilterLib ( TemplateTagTestCase ) : <EOL> preload = ( '<STR_LIT>' , ) <EOL> def test_filter_output ( self ) : <EOL> self . assert_equal ( self . render_template ( '<STR_LIT>' , a = '<STR_LIT:abc>' ) , <EOL> u'<STR_LIT>' ) <EOL> class TestBoth ( TestTagLib , TestFilterLib ) : <EOL> preload = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def _call_test_render ( self ) : <EOL> return self . render_template ( '<STR_LIT>' , <EOL> a = '<STR_LIT>' ) <EOL> def test_both_output ( self ) : <EOL> self . assert_equal ( self . _call_test_render ( ) , u'<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def test_preload_none ( self ) : <EOL> self . preload = ( ) <EOL> self . assert_raises ( self . TemplateSyntaxError , self . _call_test_render ) <EOL> def test_preload_tags_only ( self ) : <EOL> self . preload = ( '<STR_LIT>' , ) <EOL> self . assert_raises ( self . TemplateSyntaxError , self . _call_test_render ) <EOL> def test_preload_filters_only ( self ) : <EOL> self . preload = ( '<STR_LIT>' , ) <EOL> self . assert_raises ( self . TemplateSyntaxError , self . _call_test_render ) <EOL> class TestMisc ( TemplateTagTestCase ) : <EOL> def test_context ( self ) : <EOL> self . assert_equal ( self . render_template ( '<STR_LIT>' ) , u'<STR_LIT>' ) <EOL> self . assert_equal ( self . render_template ( '<STR_LIT>' , cvar = <NUM_LIT> ) , u'<STR_LIT>' ) <EOL> def test_nonexistent_taglib ( self ) : <EOL> self . preload = ( '<STR_LIT>' , ) <EOL> self . assert_raises ( self . TemplateSyntaxError , self . render_template , <EOL> '<STR_LIT>' ) </s>
