#NEWLINE# @ is_private ( ) #NEWLINE# def test_crashes( self ) : #NEWLINE# #INDENT# gpm [ 'Crash__duplicate_number' ] = 10 #NEWLINE# CrashFactory . create_batch ( 25 , signature = 'test1' ) #NEWLINE# self . assertEqual ( Crash . objects . filter ( signature = 'test1' ) . count ( ) , 25 ) #NEWLINE# CrashFactory . create_batch ( 9 , signature = 'test2' ) #NEWLINE# self . assertEqual ( Crash . objects . filter ( signature = 'test2' ) . count ( ) , 9 ) #NEWLINE# deleted = list ( Crash . objects . filter ( signature = 'test1' ) . values_list ( 'id' , 'created' , 'signature' , 'userid' , 'appid' ) ) [ : 15 ] #NEWLINE# deleted = map ( ( lambda x : dict ( id = x [ 0 ] , element_created = x [ 1 ] . strftime ( '%d. %B %Y %I:%M%p' ) , signature = x [ 2 ] , userid = x [ 3 ] , appid = x [ 4 ] ) ) , deleted ) #NEWLINE# result = delete_duplicate_crashes ( ) #NEWLINE# self . assertDictEqual ( result , dict ( count = 15 , size = 0 , elements = deleted ) ) #NEWLINE# self . assertEqual ( Crash . objects . filter ( signature = 'test1' ) . count ( ) , gpm [ 'Crash__duplicate_number' ] ) #NEWLINE# self . assertEqual ( Crash . objects . filter ( signature = 'test2' ) . count ( ) , 9 )