diff --git a/src/routers/registration.py b/src/routers/registration.py index a2e0fcf..8eb8b8c 100644 --- a/src/routers/registration.py +++ b/src/routers/registration.py @@ -54,7 +54,7 @@ async def auth(*, db: Session = Depends(get_db), request: Request): except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while create category", + detail="An error occurred while create category", ) return RedirectResponse(url="https://" + settings.DOMAIN_NAME) diff --git a/src/services/category.py b/src/services/category.py index 688c300..c22acd5 100644 --- a/src/services/category.py +++ b/src/services/category.py @@ -64,7 +64,7 @@ def create_category( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while create category", + detail="An error occurred while create category", ) else: return db_category @@ -104,7 +104,7 @@ def update_category( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while update category", + detail="An error occurred while update category", ) else: return db_category_group diff --git a/src/services/expense.py b/src/services/expense.py index cb30d74..98c5e03 100644 --- a/src/services/expense.py +++ b/src/services/expense.py @@ -69,7 +69,7 @@ def create_expense( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while create expense", + detail="An error occurred while create expense", ) else: return db_expense @@ -92,7 +92,7 @@ def update_expense( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while update expense", + detail="An error occurred while update expense", ) else: return db_expense @@ -108,7 +108,7 @@ def delete_expense(db: Session, user_id: int, group_id: int, expense_id: int) -> except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while delete expense", + detail="An error occurred while delete expense", ) diff --git a/src/services/group.py b/src/services/group.py index 58a03a4..be1c4b2 100644 --- a/src/services/group.py +++ b/src/services/group.py @@ -147,7 +147,7 @@ def remove_user( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while disband group", + detail="An error occurred while disband group", ) else: return db_users_group @@ -158,7 +158,7 @@ def remove_user( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while remove user", + detail="An error occurred while remove user", ) else: return db_user_group @@ -192,7 +192,7 @@ def leave_group( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while leave group", + detail="An error occurred while leave group", ) else: return db_users_group @@ -216,7 +216,7 @@ def leave_group( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while leave group", + detail="An error occurred while leave group", ) else: return db_user_group @@ -236,7 +236,7 @@ def create_group(db: Session, user_id: int, group: GroupCreate) -> GroupModel: except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while create group", + detail="An error occurred while create group", ) else: return db_group @@ -259,7 +259,7 @@ def update_group( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while update group", + detail="An error occurred while update group", ) else: return db_group diff --git a/src/services/invitation.py b/src/services/invitation.py index 71da6cb..a2890ba 100644 --- a/src/services/invitation.py +++ b/src/services/invitation.py @@ -62,14 +62,14 @@ def response_invitation( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while add user in group", + detail="An error occurred while add user in group", ) try: db.commit() except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while response invitation", + detail="An error occurred while response invitation", ) else: return db_invitation @@ -151,7 +151,7 @@ def create_invitation( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while create invitation", + detail="An error occurred while create invitation", ) else: return db_invitation diff --git a/src/services/replenishment.py b/src/services/replenishment.py index 3b357fd..be59cc0 100644 --- a/src/services/replenishment.py +++ b/src/services/replenishment.py @@ -24,7 +24,7 @@ def create_replenishment( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while create replenishments", + detail="An error occurred while create replenishments", ) else: return db_replenishment @@ -49,7 +49,7 @@ def update_replenishment( except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while update replenishment", + detail="An error occurred while update replenishment", ) else: return db_replenishment @@ -69,7 +69,7 @@ def delete_replenishment(db: Session, user_id: int, replenishment_id: int): except: raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, - detail=f"An error occurred while delete replenishment", + detail="An error occurred while delete replenishment", ) diff --git a/tests/test_endpoints/test_category_e.py b/tests/test_endpoints/test_category_e.py index 5ebe3c5..d2471f6 100644 --- a/tests/test_endpoints/test_category_e.py +++ b/tests/test_endpoints/test_category_e.py @@ -62,7 +62,7 @@ def test_read_categories_group(self) -> None: assert data.json() == categories_group_data def test_read_categories_group_as_non_user_group(self) -> None: - data = client.get(f"/groups/9999/categories/") + data = client.get("/groups/9999/categories/") assert data.status_code == 405 def test_create_category(self) -> None: diff --git a/tests/test_endpoints/test_expense_e.py b/tests/test_endpoints/test_expense_e.py index ec18783..7d34989 100644 --- a/tests/test_endpoints/test_expense_e.py +++ b/tests/test_endpoints/test_expense_e.py @@ -128,7 +128,7 @@ def test_delete_expense(self) -> None: ) data = client.delete(f"/groups/{self.first_group.id}/expenses/{expense.id}/") assert data.status_code == 204 - data = client.get(f"/groups/expenses/") + data = client.get("/groups/expenses/") assert data.status_code == 200 expenses_data = [] response_data = { @@ -359,7 +359,7 @@ def test_read_expenses_all_time(self) -> None: group_id=self.second_group.id, category_id=self.category.id, ) - data = client.get(f"/groups/expenses/") + data = client.get("/groups/expenses/") assert data.status_code == 200 expenses_data = [ { @@ -405,12 +405,12 @@ def test_read_expenses_all_time(self) -> None: assert data.json() == response_data def test_read_expenses_month_exc(self) -> None: - data = client.get(f"/groups/expenses/", params={"year_month": "11-2022"}) + data = client.get("/groups/expenses/", params={"year_month": "11-2022"}) assert data.status_code == 422 def test_read_expenses_month(self) -> None: time = datetime.datetime(2022, 12, 1) - data = client.get(f"/groups/expenses/", params={"year_month": "2022-12"}) + data = client.get("/groups/expenses/", params={"year_month": "2022-12"}) assert data.json() == { "items": [], "total": 0, @@ -440,7 +440,7 @@ def test_read_expenses_month(self) -> None: time=time, ) - data = client.get(f"/groups/expenses/", params={"year_month": "2022-12"}) + data = client.get("/groups/expenses/", params={"year_month": "2022-12"}) expenses_data = [ { @@ -491,7 +491,7 @@ def test_read_expenses_month(self) -> None: def test_read_expenses_time_range(self): time = datetime.datetime(2022, 12, 1) data = client.get( - f"/groups/expenses/", + "/groups/expenses/", params={"start_date": "2022-12-1", "end_date": "2022-12-12"}, ) assert data.json() == { @@ -524,7 +524,7 @@ def test_read_expenses_time_range(self): ) data = client.get( - f"/groups/expenses/", + "/groups/expenses/", params={"start_date": "2022-12-1", "end_date": "2022-12-12"}, ) expenses_data = [ @@ -575,7 +575,7 @@ def test_read_expenses_time_range(self): def test_read_expenses_time_range_date_exc(self): data = client.get( - f"/groups/expenses/", + "/groups/expenses/", params={"start_date": "2022-12-31", "end_date": "2022-12-09"}, ) assert data.status_code == 404 diff --git a/tests/test_endpoints/test_group_e.py b/tests/test_endpoints/test_group_e.py index 61bac24..ef3209d 100644 --- a/tests/test_endpoints/test_group_e.py +++ b/tests/test_endpoints/test_group_e.py @@ -131,7 +131,7 @@ def test_update_group_as_non_admin(self) -> None: title="string", description="string", icon_url="string", color_code="string" ) data = client.put( - f"/groups/9999", + "/groups/9999", json={ "title": group.title, "description": group.description, @@ -192,7 +192,7 @@ def test_leave_group_user(self) -> None: assert data == user_group_data def test_leave_group_not_found(self) -> None: - data = client.post(f"/groups/9999/leave/") + data = client.post("/groups/9999/leave/") assert data.status_code == 404 def test_leave_group_admin(self) -> None: diff --git a/tests/test_endpoints/test_invitation_e.py b/tests/test_endpoints/test_invitation_e.py index 2157c7b..cf16cea 100644 --- a/tests/test_endpoints/test_invitation_e.py +++ b/tests/test_endpoints/test_invitation_e.py @@ -201,7 +201,7 @@ def test_response_invitation(self) -> None: def test_response_invitation_not_found(self) -> None: response = UserResponseEnum.ACCEPTED data = client.post( - f"invitations/9999/response/", + "invitations/9999/response/", params={"invitation_id": 9999, "response": response}, ) assert data.status_code == 404 diff --git a/tests/test_endpoints/test_replenishment_e.py b/tests/test_endpoints/test_replenishment_e.py index 9c81829..0885867 100644 --- a/tests/test_endpoints/test_replenishment_e.py +++ b/tests/test_endpoints/test_replenishment_e.py @@ -69,7 +69,7 @@ def test_delete_replenishment(self) -> None: replenishment = ReplenishmentFactory(user_id=self.user.id) data = client.delete(f"/replenishments/{replenishment.id}/") assert data.status_code == 204 - data = client.get(f"/replenishments/") + data = client.get("/replenishments/") assert data.status_code == 200 replenishments_data = [] response_data = { @@ -84,7 +84,7 @@ def test_delete_replenishment(self) -> None: def test_read_replenishments_all_time(self) -> None: first_replenishments = ReplenishmentFactory(user_id=self.user.id) second_replenishments = ReplenishmentFactory(user_id=self.user.id) - data = client.get(f"/replenishments/") + data = client.get("/replenishments/") assert data.status_code == 200 replenishments_data = [ { @@ -115,17 +115,17 @@ def test_read_replenishments_exc_three_args(self) -> None: "end_date": "2022-12-12", "year_month": "2022-12", } - data = client.get(f"/replenishments/", params=params) + data = client.get("/replenishments/", params=params) assert data.status_code == 422 def test_read_replenishments_exc_args_no_match(self) -> None: params = {"end_date": "2022-12-12", "year_month": "2022-12"} - data = client.get(f"/replenishments/", params=params) + data = client.get("/replenishments/", params=params) assert data.status_code == 422 def test_read_replenishments_month_exc(self) -> None: params = {"year_month": "12-2022"} - data = client.get(f"/replenishments/", params=params) + data = client.get("/replenishments/", params=params) assert data.status_code == 422 def test_read_replenishments_month(self) -> None: @@ -213,5 +213,5 @@ def test_read_replenishments_time_range(self) -> None: def test_read_replenishments_time_range_date_exc(self) -> None: params = {"start_date": "2022-12-31", "end_date": "2022-12-09"} - data = client.get(f"/replenishments/", params=params) + data = client.get("/replenishments/", params=params) assert data.status_code == 404