Skip to content

Commit

Permalink
♻️ Rename routes and tests for consistency (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejsdev authored Apr 9, 2024
1 parent 102fa64 commit eb84dad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/app/api/routes/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


@router.get("/", response_model=OrganizationsPublic)
def get_organizations(
def read_organizations(
session: SessionDep, current_user: CurrentUser, skip: int = 0, limit: int = 100
) -> Any:
"""
Expand Down Expand Up @@ -58,7 +58,7 @@ def get_organizations(


@router.get("/{org_id}", response_model=OrganizationWithUserPublic)
def get_organization(
def read_organization(
session: SessionDep, current_user: CurrentUser, org_id: int
) -> Any:
"""
Expand Down
6 changes: 3 additions & 3 deletions backend/app/tests/api/routes/test_organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from app.tests.utils.user import create_user, user_authentication_headers


def test_get_organizations(client: TestClient, db: Session) -> None:
def test_read_organizations(client: TestClient, db: Session) -> None:
# Create test data in the database using db fixture
org1 = create_random_organization(db)
org2 = create_random_organization(db)
Expand Down Expand Up @@ -62,7 +62,7 @@ def test_get_organizations(client: TestClient, db: Session) -> None:
assert organizations[0]["id"] == org3.id


def test_get_organization(client: TestClient, db: Session) -> None:
def test_read_organization(client: TestClient, db: Session) -> None:
organization = create_random_organization(db)
user = create_user(session=db, email="[email protected]", password="test123")
add_user_to_organization(
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_get_organization(client: TestClient, db: Session) -> None:
assert "full_name" in item["user"]


def test_get_organization_not_found(client: TestClient) -> None:
def test_read_organization_not_found(client: TestClient) -> None:
user_auth_headers = user_authentication_headers(
client=client,
email=settings.FIRST_SUPERUSER,
Expand Down

0 comments on commit eb84dad

Please sign in to comment.