#NEWLINE# def test_database_arg_save_and_delete( self ) : #NEWLINE# #INDENT# '\n        Tests that the pre/post_save signal contains the correct database.\n        (#13552)\n        ' #NEWLINE# pre_save_receiver = DatabaseReceiver ( ) #NEWLINE# post_save_receiver = DatabaseReceiver ( ) #NEWLINE# pre_delete_receiver = DatabaseReceiver ( ) #NEWLINE# post_delete_receiver = DatabaseReceiver ( ) #NEWLINE# signals . pre_save . connect ( sender = Person , receiver = pre_save_receiver ) #NEWLINE# signals . post_save . connect ( sender = Person , receiver = post_save_receiver ) #NEWLINE# signals . pre_delete . connect ( sender = Person , receiver = pre_delete_receiver ) #NEWLINE# signals . post_delete . connect ( sender = Person , receiver = post_delete_receiver ) #NEWLINE# p = Person . objects . create ( name = 'Darth Vader' ) #NEWLINE# p . save ( ) #NEWLINE# self . assertEqual ( pre_save_receiver . _database , DEFAULT_DB_ALIAS ) #NEWLINE# self . assertEqual ( post_save_receiver . _database , DEFAULT_DB_ALIAS ) #NEWLINE# p . delete ( ) #NEWLINE# self . assertEqual ( pre_delete_receiver . _database , DEFAULT_DB_ALIAS ) #NEWLINE# self . assertEqual ( post_delete_receiver . _database , DEFAULT_DB_ALIAS ) #NEWLINE# p . save ( using = 'other' ) #NEWLINE# self . assertEqual ( pre_save_receiver . _database , 'other' ) #NEWLINE# self . assertEqual ( post_save_receiver . _database , 'other' ) #NEWLINE# p . delete ( using = 'other' ) #NEWLINE# self . assertEqual ( pre_delete_receiver . _database , 'other' ) #NEWLINE# self . assertEqual ( pre_delete_receiver . _database , 'other' )