def test_update_status_handler(self, mocked_tasks): prev_status = self.signal.status new_status = StatusFactory.create(_signal=self.signal) self.signal.status = new_status self.signal.save() update_status.send_robust(sender=self.__class__, signal_obj=self.signal, status=new_status, prev_status=prev_status) mocked_tasks.send_mail_reporter_status_changed_afgehandeld.delay.assert_called_once_with( signal_pk=self.signal.id, status_pk=new_status.id, prev_status_pk=prev_status.pk) mocked_tasks.send_mail_reporter_status_changed_heropend.delay.assert_called_once_with( signal_pk=self.signal.pk, status_pk=new_status.id, prev_status_pk=prev_status.pk) mocked_tasks.send_mail_reporter_status_changed_ingepland.delay.assert_called_once_with( signal_pk=self.signal.pk, status_pk=new_status.id, prev_status_pk=prev_status.pk) mocked_tasks.send_mail_reporter_status_changed_split.delay.assert_called_once_with( signal_pk=self.signal.pk, status_pk=new_status.id, prev_status_pk=prev_status.pk)
def test_triggered_on_update_status(self, patched_actions): prev_status = self.signal.status new_status = StatusFactory.create(_signal=self.signal, state=workflow.BEHANDELING) self.signal.status = new_status self.signal.save() update_status.send_robust(sender=self.__class__, signal_obj=self.signal, status=new_status, prev_status=prev_status)
def test_status_update_handler_object_does_not_exist(self): signal = SignalFactory.create() prev_status = signal.status new_status = StatusFactory.create(_signal=signal) signal.status = new_status signal.save() update_status.send_robust( sender=self.__class__, signal_obj=signal, status=new_status, prev_status=prev_status, )
def test_status_update_handler(self, mocked_tasks): signal = SignalFactory.create() prev_status = signal.status new_status = StatusFactory.create(_signal=signal) signal.status = new_status signal.save() update_status.send_robust( sender=self.__class__, signal_obj=signal, status=new_status, prev_status=prev_status, ) mocked_tasks.push_to_sigmax.delay.assert_called_once_with(pk=signal.id)