

154: Don't Mock your Database - Jeff Triplett
May 21, 2021
30:27
You need tests for your web app. And it has a database. What do you do with the database during testing? Should you use the real thing? or mock it? Jeff Triplett says don't mock it.
In this episode, we talk with Jeff about testing web applications, specifically Django apps, and of course talk about the downsides of database mocking.
Links:
- "🤔 In ~12 years, I have never seen a case where mocking a database was a good idea. ..."
- Django News
- Moto
- Test & Code 103: Django - Lacey Williams Henschel
- Model Bakery: Smart fixtures for better tests
- Faker
Help support the show AND learn pytest:
- The Complete pytest course is now a bundle, with each part available separately.
- pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively.
- Using pytest with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CI
- Then pytest Booster Rockets can help with advanced parametrization and building plugins.
- Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you.