How do you test request validation in FastAPI?
10mon 21d ago by lemmy.ml/u/vi21 in python@lemmy.mlThe default approach involves using TestClient. However, I found that mocking the database, background tasks, etc., is overkill. Do you have any suggestions?
If you don't want to test the round trip, have your fastapi routes call some other function and test just that function.
Do you mean moving Pydantic models as arguments of other function?