Skip to content

Commit

Permalink
disable threading in test
Browse files Browse the repository at this point in the history
we need to use TestCase threading aware
  • Loading branch information
hisham waleed karam committed Feb 7, 2019
1 parent a84096b commit f018386
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions geonode/geoserver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from celery.app import shared_task
from celery.utils.log import get_task_logger
from .utils import check_broker_status
from .utils import celery_enabled, test_running
from .helpers import gs_slurp

logger = get_task_logger(__name__)
Expand All @@ -43,8 +43,7 @@ def thumbnail_task(self, instance, overwrite=False, check_bbox=False):


def async_thumbnail(instance, overwrite=False, check_bbox=False):
celery_enabled = check_broker_status()
if celery_enabled:
if celery_enabled or test_running():
thumbnail_task.delay(
instance, overwrite=overwrite, check_bbox=check_bbox)
else:
Expand Down
8 changes: 8 additions & 0 deletions geonode/geoserver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ def check_broker_status():
running = _check_async()

return running


def test_running():
return getattr(settings, 'TEST', False) or getattr(settings, 'INTEGRATION',
False)


celery_enabled = check_broker_status()

0 comments on commit f018386

Please sign in to comment.