<s> import logging <EOL> from django import template <EOL> from django . test import TestCase <EOL> from . import admin <EOL> from . models import Box <EOL> logging . disable ( logging . CRITICAL ) <EOL> class BaseTestCase ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . box = Box . objects . create ( label = '<STR_LIT:test>' , content = '<STR_LIT>' ) <EOL> class TemplateTagTests ( BaseTestCase ) : <EOL> def render ( self , tmpl , ** context ) : <EOL> t = template . Template ( tmpl ) <EOL> return t . render ( template . Context ( context ) ) <EOL> def test_tag ( self ) : <EOL> r = self . render ( '<STR_LIT>' ) <EOL> self . assertEqual ( r , self . box . content . rendered ) <EOL> def test_tag_invalid_label ( self ) : <EOL> r = self . render ( '<STR_LIT>' ) <EOL> self . assertEqual ( r , '<STR_LIT>' ) <EOL> class ViewTests ( BaseTestCase ) : <EOL> urls = '<STR_LIT>' <EOL> def test_box_view ( self ) : <EOL> r = self . client . get ( '<STR_LIT>' ) <EOL> self . assertContains ( r , self . box . content . rendered ) </s>
