#NEWLINE# def test_post_save( self ) : #NEWLINE# #INDENT# state = [ ] #NEWLINE# @ signals . post_save ( ) #NEWLINE# def post_save( sender , instance , created ) : #NEWLINE# #INDENT# state . append ( ( sender , instance , instance . _get_pk_value ( ) , created ) ) #NEWLINE# #UNINDENT# m = ModelA ( ) #NEWLINE# m . save ( ) #NEWLINE# self . assertTrue ( ( m . id is not None ) ) #NEWLINE# self . assertEqual ( state , [ ( ModelA , m , m . id , True ) ] ) #NEWLINE# m . save ( ) #NEWLINE# self . assertEqual ( state [ ( - 1 ) ] , ( ModelA , m , m . id , False ) )