#NEWLINE# def testMultipleSimultaneousSendScripts( self ) : #NEWLINE# #INDENT# if ( 'sqlite' in settings . DATABASES [ 'default' ] [ 'ENGINE' ] ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . assertEqual ( len ( mail . outbox ) , 0 ) #NEWLINE# threads = [ Thread ( target = management . call_command , args = ( 'send_alerts' , ) ) for i in range ( 100 ) ] #NEWLINE# for t in threads : #NEWLINE# #INDENT# t . start ( ) #NEWLINE# time . sleep ( 0.001 ) #NEWLINE# #UNINDENT# [ t . join ( ) for t in threads ] #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 2 )