mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-11-01 18:48:14 +08:00
Fix #18: check for existing user on registration
This commit is contained in:
@ -76,9 +76,14 @@ class TestRegister:
|
||||
response = test_app_client.post("/register", json=json)
|
||||
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
|
||||
|
||||
def test_valid_body(self, test_app_client: TestClient):
|
||||
def test_existing_user(self, test_app_client: TestClient):
|
||||
json = {"email": "king.arthur@camelot.bt", "password": "guinevere"}
|
||||
response = test_app_client.post("/register", json=json)
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
def test_valid_body(self, test_app_client: TestClient):
|
||||
json = {"email": "lancelot@camelot.bt", "password": "guinevere"}
|
||||
response = test_app_client.post("/register", json=json)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
response_json = response.json()
|
||||
|
||||
Reference in New Issue
Block a user