Fixed unit test

pull/384/head
Piero Toffanin 2018-02-20 11:38:55 -05:00
rodzic 4dd472d8f4
commit 8304fc0991
1 zmienionych plików z 4 dodań i 8 usunięć

Wyświetl plik

@ -299,7 +299,10 @@ class TestApiTask(BootTransactionTestCase):
task_assets_path = os.path.join(settings.MEDIA_ROOT, task_directory_path(task.id, task.project.id))
self.assertFalse(os.path.exists(task_assets_path))
# Create a task, then kill the processing node
# Stop processing node
node_odm.terminate()
# Create a task
res = client.post("/api/projects/{}/tasks/".format(project.id), {
'images': [image1, image2],
'name': 'test_task_offline',
@ -309,13 +312,6 @@ class TestApiTask(BootTransactionTestCase):
self.assertTrue(res.status_code == status.HTTP_201_CREATED)
task = Task.objects.get(pk=res.data['id'])
# Stop processing node
node_odm.terminate()
task.refresh_from_db()
self.assertTrue(task.last_error is None)
worker.tasks.process_pending_tasks()
# Processing should fail and set an error
task.refresh_from_db()
self.assertTrue(task.last_error is not None)