kenken999's picture
test
ba19a97
raw
history blame
461 Bytes
from fastapi.testclient import TestClient
from app.app import app
client = TestClient(app)
def test_register_user():
response = client.post("/register", json={"username": "testuser", "password": "testpassword"})
assert response.status_code == 200
assert response.json()["message"] == "User created successfully"
def test_read_users():
response = client.get("/users/")
assert response.status_code == 200
assert len(response.json()) > 0