Skip to content

Commit

Permalink
[Fixes #11821] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Jan 29, 2024
1 parent 04c3886 commit 70703de
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions geonode/geoserver/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,9 @@ def clean_styles(layer, gs_catalog: Catalog):
# Cleanup Styles without a Workspace
gs_catalog.reset()
gs_dataset = get_dataset(layer, gs_catalog)
logger.debug(f'clean_styles: Retrieving style "{gs_dataset.default_style.name}" for cleanup')
style = gs_catalog.get_style(name=gs_dataset.default_style.name, workspace=None, recursive=True)
if gs_dataset is not None:
logger.debug(f'clean_styles: Retrieving style "{gs_dataset.default_style.name}" for cleanup')
style = gs_catalog.get_style(name=gs_dataset.default_style.name, workspace=None, recursive=True)
if style:
gs_catalog.delete(style, purge=True, recurse=False)
logger.debug(f"clean_styles: Style removed: {gs_dataset.default_style.name}")
Expand Down
2 changes: 1 addition & 1 deletion geonode/layers/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from geonode.layers import utils
from geonode.layers.utils import clear_dataset_download_handlers
from geonode.base import enumerations
from geonode.layers import DatasetAppConfig
from geonode.layers.apps import DatasetAppConfig
from geonode.layers.admin import DatasetAdmin
from geonode.decorators import on_ogc_backend
from geonode.maps.models import Map, MapLayer
Expand Down
2 changes: 1 addition & 1 deletion geonode/messaging/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from kombu.common import maybe_declare
from .queues import queue_email_events, queue_geoserver_events, queue_notifications_events, queue_dataset_viewers

from . import url, producers, connection, broker_socket_timeout, task_serializer
from geonode.messaging.apps import url, producers, connection, broker_socket_timeout, task_serializer
from .consumer import Consumer

logger = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions geonode/proxy/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class Response:
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Referrer-Policy": "same-origin",
"Cross-Origin-Opener-Policy": "same-origin",
"X-Frame-Options": "SAMEORIGIN",
"Content-Language": "en-us",
"Content-Length": "119",
Expand Down
2 changes: 1 addition & 1 deletion geonode/services/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def test_local_user_cant_delete_service(self):
self.assertEqual(s.title, "Foo Title")
self.assertEqual(s.description, "Foo Description")
self.assertEqual(s.abstract, "Foo Abstract")
self.assertEqual(["Foo", "OWS", "Service"], list(s.keywords.values_list("name", flat=True)))
self.assertSetEqual({"Foo", "OWS", "Service"}, set(list(s.keywords.values_list("name", flat=True))))
response = self.client.post(reverse("remove_service", args=(s.id,)))
self.assertEqual(len(Service.objects.all()), 0)

Expand Down

0 comments on commit 70703de

Please sign in to comment.