Skip to content

Commit 85acafd

Browse files
committed
Remove unused create_job management command
1 parent 9f78d38 commit 85acafd

File tree

3 files changed

+0
-96
lines changed

3 files changed

+0
-96
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,6 @@ jobs from the database which are in state `COMPLETE` or `FAILED` and were
209209
created more than 24 hours ago. This could be run, for example, as a cron task,
210210
to ensure the jobs table remains at a reasonable size.
211211

212-
##### manage.py create_job
213-
For debugging/development purposes, a simple management command is supplied to create jobs:
214-
215-
manage.py create_job <job_name> --queue_name 'my_queue_name' --workspace '{"key": "value"}'
216-
217-
The `workspace` flag is optional. If supplied, it must be a valid JSON string.
218-
219-
`queue_name` is optional and defaults to `default`
220-
221212
##### manage.py worker
222213
To start a worker:
223214

django_dbq/management/commands/create_job.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

django_dbq/tests.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,34 +37,6 @@ def creation_hook(job):
3737
job.workspace["output"] = "creation hook ran"
3838

3939

40-
@override_settings(JOBS={"testjob": {"tasks": ["a"]}})
41-
class JobManagementCommandTestCase(TestCase):
42-
def test_create_job(self):
43-
call_command("create_job", "testjob", stdout=StringIO())
44-
job = Job.objects.get()
45-
self.assertEqual(job.name, "testjob")
46-
self.assertEqual(job.queue_name, "default")
47-
48-
def test_create_job_with_workspace(self):
49-
workspace = '{"test": "test"}'
50-
call_command("create_job", "testjob", workspace=workspace, stdout=StringIO())
51-
job = Job.objects.get()
52-
self.assertEqual(job.workspace, {"test": "test"})
53-
54-
def test_create_job_with_queue_name(self):
55-
call_command("create_job", "testjob", queue_name="lol", stdout=StringIO())
56-
job = Job.objects.get()
57-
self.assertEqual(job.name, "testjob")
58-
self.assertEqual(job.queue_name, "lol")
59-
60-
def test_errors_raised_correctly(self):
61-
with self.assertRaises(CommandError):
62-
call_command("create_job", stdout=StringIO())
63-
64-
with self.assertRaises(CommandError):
65-
call_command("create_job", "some_other_job", stdout=StringIO())
66-
67-
6840
@override_settings(JOBS={"testjob": {"tasks": ["a"]}})
6941
class WorkerManagementCommandTestCase(TestCase):
7042
def test_worker_no_args(self):

0 commit comments

Comments
 (0)