diff --git a/antarest/study/business/areas/renewable_management.py b/antarest/study/business/areas/renewable_management.py index 2c9c0589a9..eab1b5c466 100644 --- a/antarest/study/business/areas/renewable_management.py +++ b/antarest/study/business/areas/renewable_management.py @@ -348,8 +348,7 @@ def duplicate_cluster( DuplicateRenewableCluster: If a cluster with the new name already exists in the area. """ new_id = transform_name_to_id(new_cluster_name) - lower_new_id = new_id.lower() - if any(lower_new_id == cluster.id.lower() for cluster in self.get_clusters(study, area_id)): + if any(new_id == cluster.id for cluster in self.get_clusters(study, area_id)): raise DuplicateRenewableCluster(area_id, new_id) # Cluster duplication @@ -362,7 +361,7 @@ def duplicate_cluster( # Matrix edition lower_source_id = source_id.lower() source_path = f"input/renewables/series/{area_id}/{lower_source_id}/series" - new_path = f"input/renewables/series/{area_id}/{lower_new_id}/series" + new_path = f"input/renewables/series/{area_id}/{new_id}/series" # Prepare and execute commands storage_service = self.storage_service.get_storage(study) diff --git a/tests/variantstudy/model/command/test_create_renewables_cluster.py b/tests/variantstudy/model/command/test_create_renewables_cluster.py index a38c1751e6..528988ae9b 100644 --- a/tests/variantstudy/model/command/test_create_renewables_cluster.py +++ b/tests/variantstudy/model/command/test_create_renewables_cluster.py @@ -84,7 +84,7 @@ def test_apply(self, empty_study: FileStudy, command_context: CommandContext) -> clusters = configparser.ConfigParser() clusters.read(study_path / "input" / "renewables" / "clusters" / area_id / "list.ini") - assert str(clusters[cluster_name.lower()]["name"]) == cluster_name + assert str(clusters[cluster_name.lower()]["name"]) == cluster_name.lower() assert str(clusters[cluster_name.lower()]["ts-interpretation"]) == parameters["ts-interpretation"] output = CreateRenewablesCluster(