|
|
@ -10,7 +10,7 @@ from tests.helpers import strip_microseconds
|
|
|
|
|
|
|
|
|
|
|
|
from rq.compat import PY2, as_text
|
|
|
|
from rq.compat import PY2, as_text
|
|
|
|
from rq.exceptions import NoSuchJobError, UnpickleError
|
|
|
|
from rq.exceptions import NoSuchJobError, UnpickleError
|
|
|
|
from rq.job import Job, get_current_job
|
|
|
|
from rq.job import Job, get_current_job, JobStatus
|
|
|
|
from rq.queue import Queue
|
|
|
|
from rq.queue import Queue
|
|
|
|
from rq.registry import DeferredJobRegistry
|
|
|
|
from rq.registry import DeferredJobRegistry
|
|
|
|
from rq.utils import utcformat
|
|
|
|
from rq.utils import utcformat
|
|
|
@ -307,6 +307,12 @@ class TestJob(RQTestCase):
|
|
|
|
queue = Queue(async=False)
|
|
|
|
queue = Queue(async=False)
|
|
|
|
queue.enqueue(fixtures.access_self)
|
|
|
|
queue.enqueue(fixtures.access_self)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_job_async_status_finished(self):
|
|
|
|
|
|
|
|
queue = Queue(async=False)
|
|
|
|
|
|
|
|
job = queue.enqueue(fixtures.say_hello)
|
|
|
|
|
|
|
|
self.assertEqual(job.result, 'Hi there, Stranger!')
|
|
|
|
|
|
|
|
self.assertEqual(job.get_status(), JobStatus.FINISHED)
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_result_ttl(self):
|
|
|
|
def test_get_result_ttl(self):
|
|
|
|
"""Getting job result TTL."""
|
|
|
|
"""Getting job result TTL."""
|
|
|
|
job_result_ttl = 1
|
|
|
|
job_result_ttl = 1
|
|
|
|