def test_log_update_location(self): self.assertEqual(0, Log.objects.count()) location = LocationFactory.create(_signal=self.signal) SignalLogService.log_update_location(location) 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, location.history_log.count())
def update_location_handler(sender, signal_obj, location, *args, **kwargs): """ Create a log rule """ SignalLogService.log_update_location(location)