diff --git a/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py b/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py index 74a4fdaf1c..495b48e557 100644 --- a/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py +++ b/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py @@ -117,7 +117,7 @@ def check_matrices( if values_matrix and (less_term_matrix or greater_term_matrix or equal_term_matrix): raise ValueError( "You cannot fill 'values' (matrix before v8.7) and a matrix term:" - " less_term_matrix, greater_term_matrix or equal_term_matrix (matrices since v8.7)" + " 'less_term_matrix', 'greater_term_matrix' or 'equal_term_matrix' (matrices since v8.7)" ) return values diff --git a/tests/integration/study_data_blueprint/test_binding_constraints.py b/tests/integration/study_data_blueprint/test_binding_constraints.py index 7bcd62c7da..1597eb3c7d 100644 --- a/tests/integration/study_data_blueprint/test_binding_constraints.py +++ b/tests/integration/study_data_blueprint/test_binding_constraints.py @@ -511,10 +511,11 @@ def test_lifecycle__nominal(self, client: TestClient, user_access_token: str, st headers=user_headers, ) assert res.status_code == 422 - assert ( - res.json()["description"] - == "You cannot fill 'values' (matrix before v8.7) and a matrix term: less_term_matrix (matrices since v8.7)" - ) + description = res.json()["description"] + assert "cannot fill 'values'" in description + assert "'less_term_matrix'" in description + assert "'greater_term_matrix'" in description + assert "'equal_term_matrix'" in description # Creation with wrong matrix according to version: Should fail res = client.post( @@ -531,7 +532,8 @@ def test_lifecycle__nominal(self, client: TestClient, user_access_token: str, st headers=user_headers, ) assert res.status_code == 422 - assert res.json()["description"] == "You cannot fill a 'matrix_term' as these values refer to v8.7+ studies" + description = res.json()["description"] + assert description == "You cannot fill a 'matrix_term' as these values refer to v8.7+ studies" # Wrong matrix shape wrong_matrix = np.ones((352, 3))