aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_group_purge.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_group_purge.py')
-rw-r--r--packages/meshbay-hub/tests/test_group_purge.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/meshbay-hub/tests/test_group_purge.py b/packages/meshbay-hub/tests/test_group_purge.py
index e729297..9c6a664 100644
--- a/packages/meshbay-hub/tests/test_group_purge.py
+++ b/packages/meshbay-hub/tests/test_group_purge.py
@@ -25,6 +25,7 @@ from meshbay_hub.db.models import (
ContentReport,
EmailVerification,
Group,
+ GroupInviteLink,
GroupMember,
IPLog,
Notification,
@@ -34,7 +35,8 @@ from meshbay_hub.db.purge import _referencing
from sqlalchemy import delete, func, select, text
from sqlalchemy.exc import IntegrityError
-SEEDED = {"group_members", "notifications", "email_verifications", "content_reports"}
+SEEDED = {"group_members", "notifications", "email_verifications", "content_reports",
+ "group_invite_links"}
def _auth_key(password: str, username: str) -> str:
@@ -80,6 +82,11 @@ async def _group_with_everything(client, db, owner_token: str, member: str, name
expires_at=datetime.now(UTC) + timedelta(days=1)))
db.add(ContentReport(reporter_id=member_id, content_hash="ab" * 32, group_id=gid,
ip_address="192.0.2.1"))
+ owner_id = (await db.execute(select(Group.admin_id).where(Group.id == gid))).scalar_one()
+ db.add(GroupInviteLink(group_id=gid, created_by=owner_id, ticket_hash=gid[:8] * 8,
+ email_hash="1" * 64, email_masked="m***@e***.com",
+ expires_at=datetime.now(UTC) + timedelta(days=1),
+ redeemed_by=member_id, redeemed_at=datetime.now(UTC)))
await db.commit()
return gid