Skip to content

Commit

Permalink
[Fixes #11441]Implement the update of the spatial extent for non-spat…
Browse files Browse the repository at this point in the history
…ial resource types
  • Loading branch information
mattiagiupponi committed Sep 4, 2023
1 parent 813e103 commit 5647a17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions geonode/documents/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_creation_should_create_the_doc_and_update_the_bbox(self):
"""
If file_path is not available, should raise error
"""
bbox = {"bbox": {"coords": [1, 2, 3, 4], "srid": "EPSG:9999"}}
bbox = {"bbox": {"coords": [1, 2, 3, 4], "srid": "EPSG:3857"}}

self.client.force_login(self.admin)
payload = {
Expand All @@ -164,7 +164,7 @@ def test_creation_should_create_the_doc_and_update_the_bbox(self):
self.assertEqual("xml", extension)
doc = Document.objects.filter(title="New document for testing")
self.assertTrue(doc.exists())
self.assertEqual("EPSG:9999", doc.first().srid)
self.assertEqual("EPSG:3857", doc.first().srid)

def test_file_path_and_doc_path_are_not_returned(self):
"""
Expand Down
11 changes: 10 additions & 1 deletion geonode/geoapps/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,19 @@ def test_geoapps_crud(self):
self.assertTrue(self.client.login(username="bobby", password="bob"))
# Create
url = f"{reverse('geoapps-list')}?include[]=data"
data = {"name": "Test Create", "title": "Test Create", "resource_type": "geostory", "owner": "bobby"}
data = {
"name": "Test Create",
"title": "Test Create",
"resource_type": "geostory",
"owner": "bobby",
"bbox": {"coords": [1, 2, 3, 4], "srid": "EPSG:3857"},
}
response = self.client.post(url, data=data, format="json")
self.assertEqual(response.status_code, 201) # 201 - Created

x = GeoApp.objects.filter(title="Test Create").first()
self.assertTrue(x.srid, "EPSG:3857")

response = self.client.get(url, format="json")
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data), 5)
Expand Down

0 comments on commit 5647a17

Please sign in to comment.