In production code, it returns the value of current_task imported from celery.  This in turn is a rather cool wrapper for the return value of get_current_task, which calls _task_stack.top().   I suppose I could replace reference to current_task with get_current_task(), and then     Mock that.  I'll see if that works, because this is pretty ugly.