def _check_signals_handle_raw(self, models):
     """Ensure that any post_save signal handlers have been updated
     to handle 'raw' calls."""
     whitelist_receivers = [
         'django_digest.models._post_save_persist_partial_digests'
     ]
     for model in models:
         for receiver in post_save._live_receivers(model):
             receiver_path = receiver.__module__ + '.' + receiver.__name__
             if receiver_path in whitelist_receivers:
                 continue
             args = inspect.getargspec(receiver).args
             message = 'Signal handler "{}" for model "{}" missing raw arg'.format(
                 receiver, model)
             self.assertIn('raw', args, message)
 def _check_signals_handle_raw(self, models):
     """Ensure that any post_save signal handlers have been updated
     to handle 'raw' calls."""
     whitelist_receivers = [
         'django_digest.models._post_save_persist_partial_digests'
     ]
     for model in models:
         for receiver in post_save._live_receivers(model):
             receiver_path = receiver.__module__ + '.' + receiver.__name__
             if receiver_path in whitelist_receivers:
                 continue
             args = inspect.getargspec(receiver).args
             message = 'Signal handler "{}" for model "{}" missing raw arg'.format(
                 receiver, model
             )
             self.assertIn('raw', args, message)
Exemple #3
0
 def test_create_profile_on_user_post_save_signal_receiver_registered(self):
     self.assertIn(create_profile_on_user_post_save,
                   post_save._live_receivers(sender=User))
 def test_create_profile_on_user_post_save_signal_receiver_registered(self):
     self.assertIn(create_profile_on_user_post_save, post_save._live_receivers(sender=User))
Exemple #5
0
 def test_ready(self):
     self.assertIn(confirm_subscription,
                   post_save._live_receivers(sender=Subscription))