Exemplo n.º 1
0
    def test_log_update_priority(self):
        self.assertEqual(0, Log.objects.count())

        priority = PriorityFactory.create(_signal=self.signal)
        SignalLogService.log_update_priority(priority)

        self.assertSignalsNotInLog(self.signals_no_log)

        self.assertEqual(0, Log.objects.count())
        self.assertEqual(0, self.signal.history_log.count())
        self.assertEqual(
            0,
            self.signal.history_log.exclude(action=Log.ACTION_UPDATE).count())
        self.assertEqual(
            0,
            self.signal.history_log.filter(action=Log.ACTION_UPDATE).count())
        self.assertEqual(0, priority.history_log.count())
Exemplo n.º 2
0
def update_priority_handler(sender, signal_obj, priority, *args, **kwargs):
    """
    Create a log rule
    """
    SignalLogService.log_update_priority(priority)