Skip to content

Commit

Permalink
style: change response message
Browse files Browse the repository at this point in the history
  • Loading branch information
RezenkovD committed Sep 28, 2023
1 parent 22c83de commit edaa82b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/services/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def validate_input_data(
except exc.NoResultFound:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="You are not admin in this group!",
detail="You are not admin of this group!",
)
if group.status == GroupStatusEnum.INACTIVE:
raise HTTPException(
Expand Down
2 changes: 1 addition & 1 deletion src/services/expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def validate_input_data(
except exc.NoResultFound:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="The group has no such category!",
detail="The group does not have such a category!",
)
if expense_id:
try:
Expand Down
2 changes: 1 addition & 1 deletion src/services/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def remove_user(
except exc.NoResultFound:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="You are not admin in this group!",
detail="You are not admin of this group!",
)
try:
(
Expand Down
2 changes: 1 addition & 1 deletion src/services/invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def create_invitation(
except exc.NoResultFound:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="You are not admin in this group!",
detail="You are not admin of this group!",
)
if db_group.status == GroupStatusEnum.INACTIVE:
raise HTTPException(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_services/test_category_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_create_category_not_admin(session, dependence_factory) -> None:
category = CategoryCreate(title="Book", color_code="string", icon_url="string")
with pytest.raises(HTTPException) as ex_info:
create_category(session, 9999, factories["first_group"].id, category)
assert "You are not admin in this group!" in str(ex_info.value.detail)
assert "You are not admin of this group!" in str(ex_info.value.detail)


def test_create_category_inactive_group(session) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_services/test_expense_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_create_expense_another_category(session, dependence_factory) -> None:
create_expense(
session, factories["first_user"].id, factories["first_group"].id, expense
)
assert "The group has no such category!" in str(ex_info.value.detail)
assert "The group does not have such a category!" in str(ex_info.value.detail)


def test_read_expenses_by_another_group(session) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_services/test_group_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_remove_user_as_non_admin(
factories["first_group"].id,
factories["first_user"].id,
)
assert "You are not admin in this group!" in str(ex_info.value.detail)
assert "You are not admin of this group!" in str(ex_info.value.detail)


def test_remove_inactive_user(session, dependence_factory) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_services/test_invitation_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_create_invitation_as_non_admin(session, dependence_factory) -> None:
data = InvitationCreate(recipient_id=factories["second_user"].id, group_id=9999)
with pytest.raises(HTTPException) as ex_info:
create_invitation(session, factories["first_user"].id, data)
assert "You are not admin in this group!" in str(ex_info.value.detail)
assert "You are not admin of this group!" in str(ex_info.value.detail)


def test_create_invitation_to_inactive_group(session, dependence_factory) -> None:
Expand Down

0 comments on commit edaa82b

Please sign in to comment.