def list_post_task(list_cmd_id): """ Runs :func:`kiki.utils.routing.list_post` and immediately passes the resulting list message on to the next processing step. """ try: list_cmd = ListCommand.objects.select_related().get(pk=list_cmd_id, status=ListCommand.UNPROCESSED, command="post") except ListCommand.DoesNotExist: return list_msg = list_post(list_cmd) if list_msg and list_msg.status == ListMessage.ACCEPTED: prep_list_message_task.delay(list_msg.pk)
def test_list_post(self): command = ListCommand.objects.get(pk=2) message = list_post(command) self.assertIsInstance(message, ListMessage)