def test_task_name(self, task_mock):
        """Ensure the resultant task name contains enough to be unique."""
        from sosbeacon.event.message import get_student_broadcast_task

        student_key = Mock()
        student_key.urlsafe.return_value = "STUDENTKEY"

        event_key = Mock()
        event_key.urlsafe.return_value = "EVENTKEY"

        message_key = Mock()
        message_key.urlsafe.return_value = "MESSAGEKEY"

        batch_id = "BATCHID"

        get_student_broadcast_task(student_key, event_key, message_key, batch_id)

        task_name = task_mock.call_args[1]["name"]
        self.assertIn("STUDENTKEY", task_name)
        self.assertNotIn("EVENTKEY", task_name)
        self.assertIn("MESSAGEKEY", task_name)
        self.assertIn("BATCHID", task_name)
    def test_task_params(self, task_mock):
        """Ensure the resultant task parms contain all info."""
        from sosbeacon.event.message import get_student_broadcast_task

        student_key = Mock()
        student_key.urlsafe.return_value = "ASTUDENTKEY"

        event_key = Mock()
        event_key.urlsafe.return_value = "ANEVENTKEY"

        message_key = Mock()
        message_key.urlsafe.return_value = "SOMEMESSAGEKEY"

        batch_id = "THEBATCHID"

        get_student_broadcast_task(student_key, event_key, message_key, batch_id)

        check_params = {
            "student": "ASTUDENTKEY",
            "event": "ANEVENTKEY",
            "message": "SOMEMESSAGEKEY",
            "batch": "THEBATCHID",
        }
        self.assertEqual(check_params, task_mock.call_args[1]["params"])