def receive_email_task(msg_str): """ Runs :func:`kiki.utils.routing.receive_email` and, if a message was created, passes that message on to the :func:`create_message_commands_task`. """ message, created = receive_email(msg_str) if created: create_message_commands_task.delay(message.pk)
def test_receive_email(self): message, created = receive_email(create_test_email("*****@*****.**", ["*****@*****.**"])) self.assertTrue(created) self.assertIsInstance(message, Message)