diff --git a/udata/tests/apiv2/test_datasets.py b/udata/tests/apiv2/test_datasets.py index 1eaa1f380f..1bafd372fa 100644 --- a/udata/tests/apiv2/test_datasets.py +++ b/udata/tests/apiv2/test_datasets.py @@ -1,6 +1,6 @@ from datetime import datetime -from flask import url_for +from flask import current_app, url_for import udata.core.organization.constants as org_constants from udata.core.dataset.apiv2 import DEFAULT_PAGE_SIZE @@ -53,6 +53,8 @@ def test_search_dataset(self): _dataset_org = DatasetFactory(organization=org) dataset_org_public_service = DatasetFactory(organization=org_public_service) + # This is needed or the test will fail if you have a search service configured in your udata.cfg file. + current_app.config["SEARCH_SERVICE_API_URL"] = "" response = self.get( url_for("apiv2.dataset_search", organization_badge=org_constants.PUBLIC_SERVICE) ) diff --git a/udata/tests/dataset/test_dataset_tasks.py b/udata/tests/dataset/test_dataset_tasks.py index b6e276e035..79fa3d032d 100644 --- a/udata/tests/dataset/test_dataset_tasks.py +++ b/udata/tests/dataset/test_dataset_tasks.py @@ -1,4 +1,5 @@ import pytest +from flask import current_app from udata.core.dataset import tasks @@ -22,6 +23,9 @@ def test_purge_datasets(): Dataset.objects.create(title="keep me"), ] + # This is needed or the test will fail if you have a search service configured in your udata.cfg file. + current_app.config["SEARCH_SERVICE_API_URL"] = "" + topic = Topic.objects.create(name="test topic", datasets=datasets) user = UserFactory()