

def test_enqueue_job(self):
    '\n        When scheduled job is enqueued, make sure:\n        - Job is removed from the sorted set of scheduled jobs\n        - "enqueued_at" attribute is properly set\n        - Job appears in the right queue\n        - Queue is recognized by rq\'s Queue.all()\n        '
    now = datetime.utcnow()
    queue_name = 'foo'
    scheduler = Scheduler(connection=self.testconn, queue_name=queue)
    job = scheduler.enqueue_at(now, say_hello)
    self.scheduler.enqueue_job(job)
    self.assertNotIn(job, tl(self.testconn.zrange(scheduler.scheduled_jobs_key, 0, 10)))
    job = Job.fetch(job.id, connection=self.testconn)
    self.assertTrue((job.enqueued_at is not None))
    queue = scheduler.get_queue_for_job(job)
    self.assertIn(job, queue.jobs)
    queue = Queue.from_queue_key('rq:queue:{0}'.format(queue_name))
    self.assertIn(job, queue.jobs)
    self.assertIn(queue, Queue.all())

dataset/ETHPy150Open ui/rq-scheduler/tests/test_scheduler.py TestScheduler.test_enqueue_job/VarMisuse@36/148 `queue_name`->`queue`