MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / test_register_user_forbidden_error

Function test_register_user_forbidden_error

backend/tests/users/test_api.py:81–93  ·  view source on GitHub ↗
(client: TestClient)

Source from the content-addressed store, hash-verified

79
80
81def test_register_user_forbidden_error(client: TestClient) -> None:
82 with patch("src.core.config.settings.USERS_OPEN_REGISTRATION", False):
83 username = random_email()
84 password = random_lower_string()
85 data = {"email": username, "password": password}
86 r = client.post(
87 f"{settings.API_V1_STR}/users",
88 json=data,
89 )
90 assert r.status_code == 403
91 assert (
92 r.json()["detail"] == "Open user registration is forbidden on this server"
93 )
94
95
96def test_register_user_already_exists_error(client: TestClient) -> None:

Callers

nothing calls this directly

Calls 2

random_emailFunction · 0.90
random_lower_stringFunction · 0.90

Tested by

no test coverage detected