diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-15 02:16:39 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-15 02:21:01 +0200 |
| commit | bdefcd025604f2c3009fe5e0cc01213c2ba62a6a (patch) | |
| tree | eebd34aa234a9148045ca25b00bf7c8039e00ccf /packages/meshbay-hub/tests/test_group_name_unique.py | |
| parent | 027e7d55f3bb57ba5150fd77e8f0114a0baf8d5c (diff) | |
| download | meshbay-bdefcd025604f2c3009fe5e0cc01213c2ba62a6a.tar.gz | |
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XuNrwLf5EFWCMHzfoEvnpm
Diffstat (limited to 'packages/meshbay-hub/tests/test_group_name_unique.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_group_name_unique.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/meshbay-hub/tests/test_group_name_unique.py b/packages/meshbay-hub/tests/test_group_name_unique.py index 2bc109c..ff9d42d 100644 --- a/packages/meshbay-hub/tests/test_group_name_unique.py +++ b/packages/meshbay-hub/tests/test_group_name_unique.py @@ -30,10 +30,10 @@ async def _create(client, headers, name): @pytest.mark.asyncio async def test_same_owner_same_name_is_refused(client): - alice = await _user(client, "alice") + alice = await _user(client, "alice_test") r1 = await _create(client, alice, "photos") assert r1.status_code == 201 - assert r1.json()["owner_username"] == "alice" + assert r1.json()["owner_username"] == "alice_test" r2 = await _create(client, alice, "photos") assert r2.status_code == 409 @@ -42,22 +42,22 @@ async def test_same_owner_same_name_is_refused(client): @pytest.mark.asyncio async def test_same_owner_different_case_is_refused(client): - alice = await _user(client, "alice") + alice = await _user(client, "alice_test") assert (await _create(client, alice, "Photos")).status_code == 201 assert (await _create(client, alice, " photos ")).status_code == 409 @pytest.mark.asyncio async def test_two_owners_may_share_a_name(client): - alice = await _user(client, "alice") - bob = await _user(client, "bob") + alice = await _user(client, "alice_test") + bob = await _user(client, "bob_test") assert (await _create(client, alice, "photos")).status_code == 201 assert (await _create(client, bob, "photos")).status_code == 201 @pytest.mark.asyncio async def test_name_is_trimmed_on_create(client): - alice = await _user(client, "alice") + alice = await _user(client, "alice_test") r = await _create(client, alice, " spaced out ") assert r.status_code == 201 assert r.json()["name"] == "spaced out" @@ -65,14 +65,14 @@ async def test_name_is_trimmed_on_create(client): @pytest.mark.asyncio async def test_blank_name_is_refused(client): - alice = await _user(client, "alice") + alice = await _user(client, "alice_test") assert (await _create(client, alice, " ")).status_code == 422 @pytest.mark.asyncio async def test_owner_username_is_reported_in_listings(client): - alice = await _user(client, "alice") + alice = await _user(client, "alice_test") await _create(client, alice, "photos") mine = (await client.get("/v1/groups/mine", headers=alice)).json()["groups"] - assert mine and mine[0]["owner_username"] == "alice" + assert mine and mine[0]["owner_username"] == "alice_test" |