(client: TestClient)
| 79 | |
| 80 | |
| 81 | def 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 | |
| 96 | def test_register_user_already_exists_error(client: TestClient) -> None: |
nothing calls this directly
no test coverage detected