aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_notifications.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_notifications.py')
-rw-r--r--packages/meshbay-hub/tests/test_notifications.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/packages/meshbay-hub/tests/test_notifications.py b/packages/meshbay-hub/tests/test_notifications.py
index 35ed288..02aca1c 100644
--- a/packages/meshbay-hub/tests/test_notifications.py
+++ b/packages/meshbay-hub/tests/test_notifications.py
@@ -32,7 +32,7 @@ async def _login(client, username, password="testpass99"):
return r.json()["access_token"]
-async def _setup_admin(client, admin_name="admin"):
+async def _setup_admin(client, admin_name="admin_test"):
user_id = await _register(client, admin_name, email=f"{admin_name}@x.com")
set_admin_usernames([admin_name])
token = await _login(client, admin_name)
@@ -41,8 +41,8 @@ async def _setup_admin(client, admin_name="admin"):
@pytest.mark.asyncio
async def test_notifications_empty(client):
- await _register(client, "alice", email="a@x.com")
- token = await _login(client, "alice")
+ await _register(client, "alice_test", email="a@x.com")
+ token = await _login(client, "alice_test")
r = await client.get("/v1/notifications", headers={"Authorization": f"Bearer {token}"})
assert r.status_code == 200
data = r.json()
@@ -53,8 +53,8 @@ async def test_notifications_empty(client):
@pytest.mark.asyncio
async def test_notification_on_role_change(client):
_, admin_token = await _setup_admin(client)
- uid = await _register(client, "alice", email="a@x.com")
- alice_token = await _login(client, "alice")
+ uid = await _register(client, "alice_test", email="a@x.com")
+ alice_token = await _login(client, "alice_test")
await client.patch(f"/v1/admin/users/{uid}",
json={"role": "moderator"},
@@ -72,8 +72,8 @@ async def test_notification_on_role_change(client):
@pytest.mark.asyncio
async def test_notification_on_suspend(client):
_, admin_token = await _setup_admin(client)
- uid = await _register(client, "bob", email="b@x.com")
- bob_token = await _login(client, "bob")
+ uid = await _register(client, "bob_test", email="b@x.com")
+ bob_token = await _login(client, "bob_test")
await client.patch(f"/v1/admin/users/{uid}",
json={"status": "suspended"},
@@ -94,8 +94,8 @@ async def test_notification_on_suspend(client):
@pytest.mark.asyncio
async def test_dismissing_one_deletes_it(client):
_, admin_token = await _setup_admin(client)
- uid = await _register(client, "alice", email="a@x.com")
- alice_token = await _login(client, "alice")
+ uid = await _register(client, "alice_test", email="a@x.com")
+ alice_token = await _login(client, "alice_test")
await client.patch(f"/v1/admin/users/{uid}",
json={"role": "moderator"},
@@ -122,8 +122,8 @@ async def test_dismissing_one_deletes_it(client):
@pytest.mark.asyncio
async def test_dismissing_all_deletes_them(client):
_, admin_token = await _setup_admin(client)
- uid = await _register(client, "alice", email="a@x.com")
- alice_token = await _login(client, "alice")
+ uid = await _register(client, "alice_test", email="a@x.com")
+ alice_token = await _login(client, "alice_test")
await client.patch(f"/v1/admin/users/{uid}",
json={"role": "moderator"},
@@ -151,8 +151,8 @@ async def test_dismissing_all_deletes_them(client):
@pytest.mark.asyncio
async def test_notification_unread_filter(client):
_, admin_token = await _setup_admin(client)
- uid = await _register(client, "alice", email="a@x.com")
- alice_token = await _login(client, "alice")
+ uid = await _register(client, "alice_test", email="a@x.com")
+ alice_token = await _login(client, "alice_test")
await client.patch(f"/v1/admin/users/{uid}",
json={"role": "moderator"},