|
|
@ -58,6 +58,15 @@ class TestJob(RQTestCase):
|
|
|
|
self.assertEquals(job.instance, c)
|
|
|
|
self.assertEquals(job.instance, c)
|
|
|
|
self.assertEquals(job.args, (3, 4))
|
|
|
|
self.assertEquals(job.args, (3, 4))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_create_job_from_string_function(self):
|
|
|
|
|
|
|
|
"""Creation of jobs using string specifier."""
|
|
|
|
|
|
|
|
job = Job.create('tests.fixtures.say_hello', 'World')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Job data is set
|
|
|
|
|
|
|
|
self.assertEquals(job.func, say_hello)
|
|
|
|
|
|
|
|
self.assertIsNone(job.instance)
|
|
|
|
|
|
|
|
self.assertEquals(job.args, ('World',))
|
|
|
|
|
|
|
|
|
|
|
|
def test_save(self): # noqa
|
|
|
|
def test_save(self): # noqa
|
|
|
|
"""Storing jobs."""
|
|
|
|
"""Storing jobs."""
|
|
|
|
job = Job.create(some_calculation, 3, 4, z=2)
|
|
|
|
job = Job.create(some_calculation, 3, 4, z=2)
|
|
|
|