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 3ad0ac1 commit 5b5eb7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions geonode/documents/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,24 @@ 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:3857"}}

self.client.force_login(self.admin)
payload = {
"document": {
"title": "New document for testing",
"metadata_only": True,
"file_path": self.valid_file_path,
"bbox": bbox,
"bbox": {"coords": [1, 2, 3, 4], "srid": "EPSG:3857"},
},
}
actual = self.client.post(self.url, data=payload, format="json")
self.assertEqual(201, actual.status_code)
extension = actual.json().get("document", {}).get("extension", "")
self.assertEqual("xml", extension)
doc = Document.objects.filter(title="New document for testing")
doc = Document.objects.filter(title="New document for testing").all()
self.assertTrue(doc.exists())
self.assertEqual("EPSG:3857", doc.first().srid)
x = doc.first()
x.refresh_from_db()
self.assertEqual("EPSG:3857", x.srid)

def test_file_path_and_doc_path_are_not_returned(self):
"""
Expand Down

0 comments on commit 5b5eb7b

Please sign in to comment.