#NEWLINE# def test_connect_and_disconnect_signals( self ) : #NEWLINE# #INDENT# from django.db.models import signals #NEWLINE# old_pre_save_receivers = [ r for r in signals . pre_save . receivers ] #NEWLINE# old_post_save_receivers = [ r for r in signals . post_save . receivers ] #NEWLINE# signals . pre_save . receivers = [ ] #NEWLINE# signals . post_save . receivers = [ ] #NEWLINE# self . moderation . _connect_signals ( UserProfile ) #NEWLINE# self . assertNotEqual ( signals . pre_save . receivers , [ ] ) #NEWLINE# self . assertNotEqual ( signals . post_save . receivers , [ ] ) #NEWLINE# self . moderation . _disconnect_signals ( UserProfile ) #NEWLINE# self . assertEqual ( signals . pre_save . receivers , [ ] ) #NEWLINE# self . assertEqual ( signals . post_save . receivers , [ ] ) #NEWLINE# signals . pre_save . receivers = old_post_save_receivers #NEWLINE# signals . post_save . receivers = old_post_save_receivers