Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Team add member #201

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: Add test to add and remove team member
  • Loading branch information
FranzForstmayr committed Jan 23, 2025
commit 2163ed148e72d740cd9d1c29800c05b7d42000c5
18 changes: 18 additions & 0 deletions tests/integration/test_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,21 @@ async def test_teams_delete(client: "AsyncClient", superuser_token_headers: dict
headers=superuser_token_headers,
)
assert response.status_code == 200


async def test_teams_add_remove_member(client: "AsyncClient", superuser_token_headers: dict[str, str]) -> None:
response = await client.post(
"/api/teams/81108ac1-ffcb-411d-8b1e-d91833999999/members/add",
headers=superuser_token_headers,
json={"userName": "user@example.com"},
)
assert response.status_code == 201
assert "user@example.com" in [e["email"] for e in response.json()["members"]]

response = await client.post(
"/api/teams/81108ac1-ffcb-411d-8b1e-d91833999999/members/remove",
headers=superuser_token_headers,
json={"userName": "user@example.com"},
)
assert response.status_code == 201
assert "user@example.com" not in [e["email"] for e in response.json()["members"]]