Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giohappy committed Sep 12, 2023
1 parent 7adbf7b commit 3826ad6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions geonode/documents/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_creation_should_create_the_doc_and_update_the_bbox(self):
"title": "New document for testing",
"metadata_only": True,
"file_path": self.valid_file_path,
"bbox": {"coords": [1, 2, 3, 4], "srid": "EPSG:3857"},
"bbox": {"coords": [1.0, 3.0, 2.0, 4.0], "srid": "EPSG:3857"},
},
}
actual = self.client.post(self.url, data=payload, format="json")
Expand All @@ -165,7 +165,7 @@ def test_creation_should_create_the_doc_and_update_the_bbox(self):
x = doc.first()
x.refresh_from_db()
self.assertEqual("EPSG:3857", x.srid)
self.assertEqual(x.bbox[:4], [1, 2, 3, 4])
self.assertEqual(x.bbox[:4], [1.0, 3.0, 2.0, 4.0])

def test_file_path_and_doc_path_are_not_returned(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions geonode/geoapps/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ def test_geoapps_crud(self):
"title": "Test Create",
"resource_type": "geostory",
"owner": "bobby",
"bbox": {"coords": [1, 2, 3, 4], "srid": "EPSG:3857"},
"bbox": {"coords": [1.0, 3.0, 2.0, 4.0], "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.assertEqual(x.srid, "EPSG:3857")
self.assertEqual(x.bbox[:4], [1, 2, 3, 4])
self.assertEqual(x.bbox[:4], [1.0, 3.0, 2.0, 4.0])

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

0 comments on commit 3826ad6

Please sign in to comment.