#NEWLINE# @ patch . object ( settings , 'IN_TEST_SUITE' , False ) #NEWLINE# def test_any_exception( self , urlopen ) : #NEWLINE# #INDENT# urlopen . side_effect = Exception ( ) #NEWLINE# response = self . client . post ( self . url ) #NEWLINE# assert ( response . status_code == 500 ) #NEWLINE# assert ( response . content == 'Unknown error.' )