-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: Add test to add and remove team member * fix: Add users_service to teams controller * fix: pass tag.name instead of tag for slugify
- Loading branch information
1 parent
bcfb051
commit 07340da
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "[email protected]"}, | ||
) | ||
assert response.status_code == 201 | ||
assert "[email protected]" 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": "[email protected]"}, | ||
) | ||
assert response.status_code == 201 | ||
assert "[email protected]" not in [e["email"] for e in response.json()["members"]] |