From bdefcd025604f2c3009fe5e0cc01213c2ba62a6a Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 15 Sep 2026 02:16:39 +0200 Subject: feat(hub): usernames are at least 8 characters at registration Existing shorter accounts keep signing in. Test usernames padded to match. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XuNrwLf5EFWCMHzfoEvnpm --- packages/meshbay-hub/tests/test_notifications.py | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'packages/meshbay-hub/tests/test_notifications.py') 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"}, -- cgit v1.2.3