#NEWLINE# @ moto . mock_s3 #NEWLINE# def test_bulk_delete( self ) : #NEWLINE# #INDENT# conn = boto . connect_s3 ( ) #NEWLINE# conn . create_bucket ( 'test' ) #NEWLINE# self . factory . create_batch ( 10 ) #NEWLINE# qs = self . model . objects . all ( ) #NEWLINE# self . assertEqual ( qs . count ( ) , 10 ) #NEWLINE# keys = conn . get_bucket ( 'test' ) . get_all_keys ( ) #NEWLINE# self . assertEqual ( len ( my_mock ) , ( len ( self . file_fields ) * 10 ) ) #NEWLINE# with mock . patch ( 'boto.__init__' ) as my_mock : #NEWLINE# #INDENT# my_mock . connect_s3 . return_value = conn #NEWLINE# try : #NEWLINE# #INDENT# bulk_delete ( self . model , qs ) #NEWLINE# #UNINDENT# except boto . exception . S3ResponseError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# keys = conn . get_bucket ( 'test' ) . get_all_keys ( ) #NEWLINE# self . assertFalse ( keys )