This commit is contained in:
parent
4eb0e727b9
commit
3ee228f69a
|
|
@ -215,6 +215,14 @@ class BackgroundTaskTestCase(TestCase):
|
|||
get_queue('high').connection.flushall()
|
||||
get_queue('low').connection.flushall()
|
||||
|
||||
def tearDown(self):
|
||||
super().tearDown()
|
||||
|
||||
# Clear all queues after each test so no leftover jobs leak into the next test suite
|
||||
get_queue('default').connection.flushall()
|
||||
get_queue('high').connection.flushall()
|
||||
get_queue('low').connection.flushall()
|
||||
|
||||
def test_background_queue_list(self):
|
||||
url = reverse('core:background_queue_list')
|
||||
|
||||
|
|
|
|||
|
|
@ -1155,6 +1155,12 @@ class ScriptTestCase(APITestCase):
|
|||
# Monkey-patch the Script model to return our TestScriptClass above
|
||||
Script.python_class = self.python_class
|
||||
|
||||
# The script-run endpoint gates on a live RQ worker. Tests run without
|
||||
# one, so bypass the check to exercise validation and the enqueue path.
|
||||
worker_patch = patch('extras.api.views.any_workers_for_queue', return_value=True)
|
||||
worker_patch.start()
|
||||
self.addCleanup(worker_patch.stop)
|
||||
|
||||
def test_get_script(self):
|
||||
response = self.client.get(self.url, **self.header)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue