From f42a273b637d2c04bc0d24b6f332d1d87d794cca Mon Sep 17 00:00:00 2001 From: Nargis Sultani Date: Fri, 15 Mar 2024 16:24:01 -0400 Subject: [PATCH] Addressed the comment --- src/entities/models/dto.py | 3 ++- tests/api/routers/test_institutions_api.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/entities/models/dto.py b/src/entities/models/dto.py index 4e7a283..4b61607 100644 --- a/src/entities/models/dto.py +++ b/src/entities/models/dto.py @@ -90,7 +90,8 @@ def validate_fi(self) -> "FinancialInstitutionDto": match = re.match(r"^([a-zA-Z0-9]{20})", self.lei) if not match: raise ValueError( - f"Invalid lei {self.lei}. FinancialInstitution lei can only contain letters and numbers." + f"Invalid lei {self.lei}. FinancialInstitution lei must be 20 characaters long and contain only " + "letters and numbers." ) return self diff --git a/tests/api/routers/test_institutions_api.py b/tests/api/routers/test_institutions_api.py index b6d495f..50cb95e 100644 --- a/tests/api/routers/test_institutions_api.py +++ b/tests/api/routers/test_institutions_api.py @@ -97,7 +97,8 @@ def test_invalid_lei(self, mocker: MockerFixture, app_fixture: FastAPI, authed_u ) assert ( res.json()["detail"][0]["msg"] - == "Value error, Invalid lei test_Lei. FinancialInstitution lei can only contain letters and numbers." + == "Value error, Invalid lei test_Lei. FinancialInstitution lei must be 20 characaters long and contain " + "only letters and numbers." ) assert res.status_code == 422