diff --git a/tests/__init__.py b/tests/__init__.py index 3109684..b912bed 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -53,12 +53,3 @@ class RQTestCase(unittest.TestCase): testconn = conn.pop() assert testconn == cls.testconn, 'Wow, something really nasty happened to the Redis connection stack. Check your setup.' - - def assertQueueContains(self, queue, that_func): - # Do a queue scan (this is O(n), but we're in a test, so hey) - for job in queue.jobs: - if job.func == that_func: - return - self.fail('Queue %s does not contain message for function %s' % - (queue.key, that_func)) - diff --git a/tests/test_queue.py b/tests/test_queue.py index ff18e9e..071891f 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -46,7 +46,11 @@ class TestQueue(RQTestCase): # testjob spec holds which queue this is sent to q.enqueue(testjob, 'Nick', foo='bar') self.assertEquals(q.is_empty(), False) - self.assertQueueContains(q, testjob) + for job in q.jobs: + if job.func == testjob: + break + else: + self.fail('Job not found on queue.') def test_dequeue(self):