Skip to content

Commit

Permalink
[Fixes GeoNode#10142] storage_manager copy dont assign the folder/fil…
Browse files Browse the repository at this point in the history
…e permi… (GeoNode#10143) (GeoNode#10154)

* [Fixes GeoNode#10142] storage_manager copy dont assign the folder/file permissions correcly

* [Fixes GeoNode#10142] storage_manager copy dont assign the folder/file permissions correcly

* [Fixes GeoNode#10142] storage_manager copy dont assign the folder/file permissions correcly

* [Fixes GeoNode#10142] storage_manager copy dont assign the folder/file permissions correcly

* [Fixes GeoNode#10142] storage_manager copy dont assign the folder/file permissions correcly

Co-authored-by: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com>
  • Loading branch information
2 people authored and ridoo committed Sep 18, 2023
1 parent e6809ad commit 2dd5265
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions geonode/storage/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,22 @@ def test_storage_manager_copy(self):
os.remove(output.get("files")[0])
self.assertFalse(os.path.exists(output.get("files")[0]))

@override_settings(FILE_UPLOAD_DIRECTORY_PERMISSIONS=0o777)
@override_settings(FILE_UPLOAD_PERMISSIONS=0o777)
def test_storage_manager_copy(self):
'''
Test that the copy works as expected and the permissions are corerct
'''
dataset = create_single_dataset(name="test_copy")
dataset.files = [os.path.join(f"{self.project_root}", "tests/data/test_sld.sld")]
dataset.save()
output = self.sut().copy(dataset)

self.assertTrue(os.path.exists(output.get("files")[0]))
self.assertEqual(os.stat(os.path.exists(output.get("files")[0])).st_mode, 8592)
os.remove(output.get("files")[0])
self.assertFalse(os.path.exists(output.get("files")[0]))


class TestDataRetriever(TestCase):
@classmethod
Expand Down

0 comments on commit 2dd5265

Please sign in to comment.