#NEWLINE# def test_can_tell_if_the_user_is_the_owner_of_a_post( self ) : #NEWLINE# #INDENT# def get_rendered( post , user ) : #NEWLINE# #INDENT# request = self . get_request ( ) #NEWLINE# request . user = user #NEWLINE# t = Template ( ( self . loadstatement + '{% if post|posted_by:request.user %}OWNER{% else %}NO_OWNER{% endif %}' ) ) #NEWLINE# c = Context ( { #NEWLINE# #INDENT# 'post' : post , #NEWLINE# 'request' : request , #NEWLINE# #UNINDENT# } ) #NEWLINE# rendered = t . render ( c ) #NEWLINE# return rendered #NEWLINE# #UNINDENT# assert ( get_rendered ( get_rendered . post_1 , self . u1 ) == 'OWNER' ) #NEWLINE# assert ( get_rendered ( self . post_2 , self . u1 ) == 'NO_OWNER' )