#NEWLINE# def assertNotContains( self , response , text , status_code = 200 , msg_prefix = '' , html = False ) : #NEWLINE# #INDENT# "\n        Asserts that a response indicates that some content was retrieved\n        successfully, (i.e., the HTTP status code was as expected), and that\n        ``text`` doesn't occurs in the content of the response.\n        " #NEWLINE# if ( hasattr ( text , 'render' ) and callable ( response . render ) and ( not response . is_rendered ) ) : #NEWLINE# #INDENT# response . render ( ) #NEWLINE# #UNINDENT# if msg_prefix : #NEWLINE# #INDENT# msg_prefix += ': ' #NEWLINE# #UNINDENT# self . assertEqual ( response . status_code , status_code , ( msg_prefix + ( "Couldn't retrieve content: Response code was %d (expected %d)" % ( response . status_code , status_code ) ) ) ) #NEWLINE# text = force_text ( text , encoding = response . _charset ) #NEWLINE# content = response . content . decode ( response . _charset ) #NEWLINE# if html : #NEWLINE# #INDENT# content = assert_and_parse_html ( self , content , None , "Response's content is not valid HTML:" ) #NEWLINE# text = assert_and_parse_html ( self , text , None , 'Second argument is not valid HTML:' ) #NEWLINE# #UNINDENT# self . assertEqual ( content . count ( text ) , 0 , ( msg_prefix + ( "Response should not contain '%s'" % text ) ) )