<s> from nose . tools import ok_ <EOL> import unittest <EOL> from db . models import ComradeBaseModel <EOL> def check_direct_to_template ( prefix , pattern ) : <EOL> from django import test <EOL> from django . core . urlresolvers import reverse <EOL> client = test . Client ( ) <EOL> response = client . get ( reverse ( prefix + '<STR_LIT::>' + pattern . name ) ) <EOL> template_name = pattern . default_args [ '<STR_LIT>' ] <EOL> template_names = [ t . name for t in test . testcases . to_list ( response . template ) ] <EOL> ok_ ( template_names ) <EOL> ok_ ( template_name in template_names , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" % <EOL> ( template_name , u'<STR_LIT:U+002CU+0020>' . join ( template_names ) ) ) <EOL> class SimpleModel ( ComradeBaseModel ) : <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' <EOL> class TestBaseModel ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestBaseModel , self ) . setUp ( ) <EOL> self . obj = SimpleModel ( ) <EOL> def test_repr ( self ) : <EOL> ok_ ( isinstance ( self . obj . __repr__ ( ) , str ) ) <EOL> def test_str ( self ) : <EOL> ok_ ( isinstance ( self . obj . __str__ ( ) , str ) ) <EOL> def test_unicode ( self ) : <EOL> ok_ ( isinstance ( self . obj . __unicode__ ( ) , unicode ) ) </s>
