#NEWLINE# def test_with_user_no_images_from_banned_users( self ) : #NEWLINE# #INDENT# "Images from banned users shouldn't be present." #NEWLINE# thread = mommy . make ( 'connectmessages.Thread' , group = self . group ) #NEWLINE# message = mommy . make ( 'connectmessages.Message' , thread = thread , sender = self . banned_user ) #NEWLINE# image1 = Image ( ) #NEWLINE# image1 . user = message . sender #NEWLINE# image1 . image = File ( open ( self . smallfile ) ) #NEWLINE# image1 . save ( ) #NEWLINE# message . images . add ( image1 ) #NEWLINE# result = self . client . get ( reverse ( 'admin_gallery' ) ) #NEWLINE# self . assertEqual ( result . status_code , 200 ) #NEWLINE# self . assertNotIn ( image1 , result . context [ 'images' ] )