From edaa82b5ed1ab4263b47aab2fcead0ce0778c08d Mon Sep 17 00:00:00 2001 From: RezenkovD Date: Thu, 28 Sep 2023 18:47:20 +0300 Subject: [PATCH] style: change response message --- src/services/category.py | 2 +- src/services/expense.py | 2 +- src/services/group.py | 2 +- src/services/invitation.py | 2 +- tests/test_services/test_category_s.py | 2 +- tests/test_services/test_expense_s.py | 2 +- tests/test_services/test_group_s.py | 2 +- tests/test_services/test_invitation_s.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/services/category.py b/src/services/category.py index c22acd5..bc7afa8 100644 --- a/src/services/category.py +++ b/src/services/category.py @@ -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( diff --git a/src/services/expense.py b/src/services/expense.py index 3a63d03..6852c22 100644 --- a/src/services/expense.py +++ b/src/services/expense.py @@ -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: diff --git a/src/services/group.py b/src/services/group.py index 4b9aaf4..e8eea0d 100644 --- a/src/services/group.py +++ b/src/services/group.py @@ -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: ( diff --git a/src/services/invitation.py b/src/services/invitation.py index 3092838..04478c0 100644 --- a/src/services/invitation.py +++ b/src/services/invitation.py @@ -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( diff --git a/tests/test_services/test_category_s.py b/tests/test_services/test_category_s.py index 97c05f4..f80ec84 100644 --- a/tests/test_services/test_category_s.py +++ b/tests/test_services/test_category_s.py @@ -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: diff --git a/tests/test_services/test_expense_s.py b/tests/test_services/test_expense_s.py index f760100..6a56085 100644 --- a/tests/test_services/test_expense_s.py +++ b/tests/test_services/test_expense_s.py @@ -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: diff --git a/tests/test_services/test_group_s.py b/tests/test_services/test_group_s.py index 64481d1..9568058 100644 --- a/tests/test_services/test_group_s.py +++ b/tests/test_services/test_group_s.py @@ -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: diff --git a/tests/test_services/test_invitation_s.py b/tests/test_services/test_invitation_s.py index b1ae653..b2d2691 100644 --- a/tests/test_services/test_invitation_s.py +++ b/tests/test_services/test_invitation_s.py @@ -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: