Skip to content

Commit 8366708

Browse files
committed
fix tests
1 parent b79104e commit 8366708

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

gateway/api/views/jobs.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from api.repositories.functions import FunctionRepository
3232
from api.repositories.providers import ProviderRepository
3333
from api.serializers import JobSerializer, JobSerializerWithoutResult
34-
from api.management.commands.update_jobs_statuses import update_job_status
3534

3635
# pylint: disable=duplicate-code
3736
logger = logging.getLogger("gateway")
@@ -266,6 +265,14 @@ def sub_status(self, request, pk=None):
266265

267266
def set_sub_status():
268267
job = self.jobs_repository.get_job_by_id(pk)
268+
269+
# If we import this with the regular imports,
270+
# update jobs statuses test command fail.
271+
# it should be something related with python import order.
272+
from api.management.commands.update_jobs_statuses import ( # pylint: disable=import-outside-toplevel
273+
update_job_status,
274+
)
275+
269276
update_job_status(job)
270277

271278
if job is None:

0 commit comments

Comments
 (0)