diff --git a/geonode/storage/tests.py b/geonode/storage/tests.py index 48d1f3ebfe2..3f98844f8ee 100644 --- a/geonode/storage/tests.py +++ b/geonode/storage/tests.py @@ -573,7 +573,22 @@ def test_zip_file_should_correctly_recognize_main_extension_with_csv(self): self.assertIsNotNone(storage_manager.data_retriever.temporary_folder) _files = storage_manager.get_retrieved_paths() - self.assertTrue("example.csv" in _files.get("base_file")) + # Selected base_file is not defined in case of multiple csv files + self.assertTrue(_files.get("base_file").endswith(".csv")) + + def test_zip_file_should_correctly_relate_file_extensions(self): + # reinitiate the storage manager with the zip file + storage_manager = self.sut( + remote_files={"base_file": os.path.join(f"{self.project_root}", "tests/data/example.zip")} + ) + storage_manager.clone_remote_files() + + self.assertIsNotNone(storage_manager.data_retriever.temporary_folder) + _files = storage_manager.get_retrieved_paths() + # Selected base_file is not defined in case of multiple csv files + self.assertIsNotNone(_files.get("csv_file")) + # extensions found more than once get indexed + self.assertIsNotNone(_files.get("csv_file_1")) @override_settings( SUPPORTED_DATASET_FILE_TYPES=[ diff --git a/geonode/storage/tests/data/example.zip b/geonode/storage/tests/data/example.zip index 099888b8ef3..bb54c689f54 100644 Binary files a/geonode/storage/tests/data/example.zip and b/geonode/storage/tests/data/example.zip differ