aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_group_hosting.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_group_hosting.py')
-rw-r--r--packages/meshbay-hub/tests/test_group_hosting.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/meshbay-hub/tests/test_group_hosting.py b/packages/meshbay-hub/tests/test_group_hosting.py
index c6111f2..7aa6bd1 100644
--- a/packages/meshbay-hub/tests/test_group_hosting.py
+++ b/packages/meshbay-hub/tests/test_group_hosting.py
@@ -17,6 +17,7 @@ import hashlib
from datetime import UTC, datetime, timedelta
import pytest
+from membership import add_member
from meshbay_hub.db.models import Group, GroupMember
from meshbay_hub.tasks.cleanup import find_unhosted_groups, prune_unhosted_groups
from sqlalchemy import select
@@ -72,7 +73,7 @@ async def test_a_member_does_not_see_an_unhosted_group(client):
owner = await _user(client, "setup2_test")
member = await _user(client, "early_bird")
gid = (await _group(client, owner, "premature")).json()["group_id"]
- await client.post(f"/v1/groups/{gid}/members/early_bird", json={}, headers=owner)
+ await add_member(client, gid, 'early_bird', owner)
mine = await client.get("/v1/groups/mine", headers=member)
assert [g["name"] for g in mine.json()["groups"]] == []
@@ -83,7 +84,7 @@ async def test_a_member_sees_it_once_a_node_has_announced_it(client, db_session)
owner = await _user(client, "setup3_test")
member = await _user(client, "patient_test")
gid = (await _group(client, owner, "ready")).json()["group_id"]
- await client.post(f"/v1/groups/{gid}/members/patient_test", json={}, headers=owner)
+ await add_member(client, gid, 'patient_test', owner)
await _mark_hosted(db_session, gid)
@@ -174,7 +175,7 @@ async def test_collecting_a_group_takes_its_memberships_with_it(client, db_sessi
owner = await _user(client, "reaper5_test")
await _user(client, "tagalong")
gid = (await _group(client, owner, "doomed")).json()["group_id"]
- await client.post(f"/v1/groups/{gid}/members/tagalong", json={}, headers=owner)
+ await add_member(client, gid, 'tagalong', owner)
g = await db_session.get(Group, gid)
g.created_at = datetime.now(UTC) - timedelta(days=9)