<s> from django . test import TestCase <EOL> from django import template <EOL> import re <EOL> from categories . models import Category <EOL> class CategoryTagsTest ( TestCase ) : <EOL> fixtures = [ '<STR_LIT>' ] <EOL> def render_template ( self , template_string , context = { } ) : <EOL> """<STR_LIT>""" <EOL> tpl = template . Template ( template_string ) <EOL> ctxt = template . Context ( context ) <EOL> return tpl . render ( ctxt ) <EOL> def testTooFewArguments ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertRaises ( template . TemplateSyntaxError , self . render_template , '<STR_LIT>' ) <EOL> def testBasicUsage ( self ) : <EOL> """<STR_LIT>""" <EOL> rock_resp = '<STR_LIT>' <EOL> resp = self . render_template ( '<STR_LIT>' ) <EOL> resp = re . sub ( r'<STR_LIT>' , "<STR_LIT>" , resp ) <EOL> self . assertEqual ( resp , rock_resp ) <EOL> expected_resp = '<STR_LIT>' <EOL> resp = self . render_template ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> resp = re . sub ( r'<STR_LIT>' , "<STR_LIT>" , resp ) <EOL> self . assertEqual ( resp , expected_resp ) <EOL> expected_resp = '<STR_LIT>' <EOL> resp = self . render_template ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( resp , expected_resp ) <EOL> expected_resp = '<STR_LIT>' <EOL> resp = self . render_template ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( resp , expected_resp ) <EOL> expected_resp = "<STR_LIT>" <EOL> resp = self . render_template ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( resp , expected_resp ) <EOL> expected_resp = '<STR_LIT>' <EOL> ctxt = { '<STR_LIT>' : Category . objects . filter ( name__in = ( "<STR_LIT>" , "<STR_LIT>" ) ) } <EOL> resp = self . render_template ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , ctxt ) <EOL> self . assertEqual ( resp , expected_resp ) </s>
