Skip to content

Commit

Permalink
Addressed the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nargis Sultani committed Mar 15, 2024
1 parent 231a10c commit f42a273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/entities/models/dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion tests/api/routers/test_institutions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f42a273

Please sign in to comment.