aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_group_membership.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_group_membership.py')
-rw-r--r--packages/meshbay-hub/tests/test_group_membership.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/meshbay-hub/tests/test_group_membership.py b/packages/meshbay-hub/tests/test_group_membership.py
index 7eeaa2f..2761595 100644
--- a/packages/meshbay-hub/tests/test_group_membership.py
+++ b/packages/meshbay-hub/tests/test_group_membership.py
@@ -41,7 +41,7 @@ async def _group_with_member(client, owner, member_name, name="crew"):
@pytest.mark.asyncio
async def test_the_owner_removes_a_member(client, db_session):
- owner = await _user(client, "chief")
+ owner = await _user(client, "chief_test")
await _user(client, "hanger_on")
gid = await _group_with_member(client, owner, "hanger_on")
@@ -52,7 +52,7 @@ async def test_the_owner_removes_a_member(client, db_session):
select(GroupMember).where(GroupMember.group_id == gid))).scalars().all()
assert [m.user_id for m in rows] != [], "the owner lost their own membership"
names = {(await db_session.get(User, m.user_id)).username for m in rows}
- assert names == {"chief"}
+ assert names == {"chief_test"}
@pytest.mark.asyncio
@@ -61,7 +61,7 @@ async def test_removing_a_member_is_not_deleting_an_account(client, db_session):
The account survives untouched, with its other groups. Anything else would
make one group's owner able to erase someone from the whole hub.
"""
- owner = await _user(client, "boss")
+ owner = await _user(client, "boss_test")
member = await _user(client, "member_x")
elsewhere = await _user(client, "other_owner")
@@ -83,7 +83,7 @@ async def test_removing_a_member_is_not_deleting_an_account(client, db_session):
@pytest.mark.asyncio
async def test_a_member_cannot_remove_anyone(client):
- owner = await _user(client, "owner_y")
+ owner = await _user(client, "owner_y_test")
member = await _user(client, "member_y")
await _user(client, "victim_y")
gid = await _group_with_member(client, owner, "member_y")
@@ -96,16 +96,16 @@ async def test_a_member_cannot_remove_anyone(client):
@pytest.mark.asyncio
async def test_the_owner_cannot_be_removed_from_their_own_group(client):
"""Otherwise the group is left with nobody who can invite or remove."""
- owner = await _user(client, "owner_z")
- gid = await _group_with_member(client, owner, "owner_z")
+ owner = await _user(client, "owner_z_test")
+ gid = await _group_with_member(client, owner, "owner_z_test")
- r = await client.delete(f"/v1/groups/{gid}/members/owner_z", headers=owner)
+ r = await client.delete(f"/v1/groups/{gid}/members/owner_z_test", headers=owner)
assert r.status_code == 409
@pytest.mark.asyncio
async def test_removing_someone_who_is_not_a_member_says_so(client):
- owner = await _user(client, "owner_w")
+ owner = await _user(client, "owner_w_test")
await _user(client, "stranger")
g = await client.post("/v1/groups", json={"name": "closed"}, headers=owner)
gid = g.json()["group_id"]