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_recovery_email.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_recovery_email.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_recovery_email.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/meshbay-hub/tests/test_recovery_email.py b/packages/meshbay-hub/tests/test_recovery_email.py index c6dab97..07880d0 100644 --- a/packages/meshbay-hub/tests/test_recovery_email.py +++ b/packages/meshbay-hub/tests/test_recovery_email.py @@ -44,8 +44,8 @@ def _skip_email_verification(monkeypatch): async def test_register_appends_the_recovery_key_to_the_email( client, _skip_email_verification): r = await client.post("/v1/users/register", json={ - "username": "rk1", "email": "rk1@example.com", - "auth_key": _auth_key("a-long-enough-passphrase", "rk1"), + "username": "rk1_test", "email": "rk1@example.com", + "auth_key": _auth_key("a-long-enough-passphrase", "rk1_test"), "recovery_key": RECOVERY, }) assert r.status_code in (200, 201), r.text @@ -59,8 +59,8 @@ async def test_register_appends_the_recovery_key_to_the_email( async def test_register_without_recovery_key_sends_only_the_code( client, _skip_email_verification): r = await client.post("/v1/users/register", json={ - "username": "rk2", "email": "rk2@example.com", - "auth_key": _auth_key("a-long-enough-passphrase", "rk2"), + "username": "rk2_test", "email": "rk2@example.com", + "auth_key": _auth_key("a-long-enough-passphrase", "rk2_test"), }) assert r.status_code in (200, 201), r.text body = _skip_email_verification[0].get_content() @@ -72,8 +72,8 @@ async def test_register_without_recovery_key_sends_only_the_code( async def test_the_recovery_key_is_not_persisted( client, db_session, _skip_email_verification): await client.post("/v1/users/register", json={ - "username": "rk3", "email": "rk3@example.com", - "auth_key": _auth_key("a-long-enough-passphrase", "rk3"), + "username": "rk3_test", "email": "rk3@example.com", + "auth_key": _auth_key("a-long-enough-passphrase", "rk3_test"), "recovery_key": RECOVERY, }) rows = (await db_session.execute(select(EmailVerification))).scalars().all() @@ -82,7 +82,7 @@ async def test_the_recovery_key_is_not_persisted( assert RECOVERY not in (row.code or "") assert RECOVERY not in (row.email_encrypted or "") user = (await db_session.execute( - select(User).where(User.username == "rk3"))).scalar_one() + select(User).where(User.username == "rk3_test"))).scalar_one() assert RECOVERY not in repr(vars(user)) |