Skip to content

Commit

Permalink
[Fixes #11441] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Sep 5, 2023
1 parent 5647a17 commit 3ad0ac1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion geonode/base/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def to_internal_value(self, data):
return data

def save(self, **kwargs):
instance = super().save()
instance = super().save(**kwargs)
if (
"bbox" in self.initial_data
and instance.get_real_instance().resource_type in ["document", "geoapp"] + get_geoapp_subtypes()
Expand Down
4 changes: 2 additions & 2 deletions geonode/base/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2921,7 +2921,7 @@ def test_document_should_update_bbox(self):

self.assertEqual(200, response.status_code)
self.doc.refresh_from_db()
expected = "POLYGON ((-102.88263699484445 -102.88263354727535, -102.88263699484445 30.06770751904323, 30.067704520339284 30.06770751904323, 30.067704520339284 -102.88263354727535, -102.88263699484445 -102.88263354727535))" # noqa
expected = "POLYGON ((-102.88263699484445 -102.88263354727535, -102.88263699484445 30.06770751904323, 30.067704520339273 30.06770751904323, 30.067704520339273 -102.88263354727535, -102.88263699484445 -102.88263354727535))" # noqa
self.assertEqual(self.doc.ll_bbox_polygon.wkt, expected)
self.assertEqual("EPSG:3456", self.doc.srid)

Expand All @@ -2936,6 +2936,6 @@ def test_geoapp_should_update_bbox(self):

self.assertEqual(200, response.status_code)
self.geoapp.refresh_from_db()
expected = "POLYGON ((-102.88263699484445 -102.88263354727535, -102.88263699484445 30.06770751904323, 30.067704520339284 30.06770751904323, 30.067704520339284 -102.88263354727535, -102.88263699484445 -102.88263354727535))" # noqa
expected = "POLYGON ((-102.88263699484445 -102.88263354727535, -102.88263699484445 30.06770751904323, 30.067704520339273 30.06770751904323, 30.067704520339273 -102.88263354727535, -102.88263699484445 -102.88263354727535))" # noqa
self.assertEqual(self.geoapp.ll_bbox_polygon.wkt, expected)
self.assertEqual("EPSG:3456", self.geoapp.srid)
4 changes: 2 additions & 2 deletions geonode/documents/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from urllib.parse import urljoin

from django.urls import reverse
from rest_framework.test import APITestCase
from rest_framework.test import APITransactionTestCase

from guardian.shortcuts import assign_perm, get_anonymous_user
from geonode import settings
Expand All @@ -34,7 +34,7 @@
logger = logging.getLogger(__name__)


class DocumentsApiTests(APITestCase):
class DocumentsApiTests(APITransactionTestCase):
fixtures = ["initial_data.json", "group_test_data.json", "default_oauth_apps.json"]

def setUp(self):
Expand Down

0 comments on commit 3ad0ac1

Please sign in to comment.