Django’s Magic, FastAPI’s Reality: Test Isolation at Scale
2026-07-16 , Chamber Hall B (S3B)

Your FastAPI + SQLAlchemy tests pass alone but fail together. Data leaks between tests, and cleanup becomes slower. Meanwhile, it seems effortless in Django. Why?

This isn't a framework war - we'll dig into what Django actually does behind the scenes to keep the database clean between tests and why that approach isn’t straightforward to replicate in a typical SQLAlchemy setup.

We'll explore common cleanup strategies like recreating schema, truncating, transaction wrapping or template databases and benchmark how they scale as your test suite grows.

You'll leave with a clear understanding of why this problem exists and practical, benchmarked options to keep your test suite fast and data isolated.

Aimed at intermediate Python developers comfortable with writing tests and familiar with basic database concepts like transactions.


Expected audience expertise: Intermediate

Maciej is pretty much as regular as the next developer. Feels best as jack of many trades. Loves to share his knowledge and make better tools for people.