From 62b6b180f3fe1de6e40e20bb40b739667d40dfdb Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 15 Nov 2011 09:36:38 +0100 Subject: [PATCH] Also allow args and kwargs to enqueue() calls on Queue. --- rq/queue.py | 4 ++-- tests/test_rq.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rq/queue.py b/rq/queue.py index 0ad9270..81d3854 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -28,8 +28,8 @@ class Queue(object): def count(self): return conn.llen(self.key) - def enqueue(self, job): - return job.enqueue(self) + def enqueue(self, job, *args, **kwargs): + return job.enqueue(self, *args, **kwargs) def dequeue(self): s = conn.lpop(self.key) diff --git a/tests/test_rq.py b/tests/test_rq.py index c7c9d51..ab8818b 100644 --- a/tests/test_rq.py +++ b/tests/test_rq.py @@ -157,7 +157,7 @@ class TestJob(RQTestCase): q = Queue('alt-queue') self.assertEquals(q.empty, True) - q.enqueue(testjob) + q.enqueue(testjob, 'Simon') self.assertEquals(q.empty, False) self.assertQueueContains(q, testjob)