#NEWLINE# def test_fast_delete_large_batch( self ) : #NEWLINE# #INDENT# User . objects . bulk_create ( ( User ( ) for i in range ( 0 , 2000 ) ) ) #NEWLINE# self . assertNumQueries ( 1 , User . objects . all ( ) . delete ) #NEWLINE# a = Avatar . objects . create ( desc = 'a' ) #NEWLINE# User . objects . bulk_create ( ( User ( avatar = i ) for i in range ( 0 , 2000 ) ) ) #NEWLINE# self . assertNumQueries ( 2 , a . delete ) #NEWLINE# self . assertEqual ( User . objects . count ( ) , 0 )