Django and Wiremock: End-to-end tests made easy
summary
Django app that manages Minecraft servers sends HTTP broadcasts using requests; unit tests mocked requests but refactors and network flakiness motivate real end-to-end tests. WireMock runs as jar or Docker and returns configurable responses, can simulate 500/latency/stateful retries and record/playback mappings; tests start the app (migrations, session login), hit its public endpoints via requests, assert response codes and request counts, and use Testcontainers in CI. WireMock is proven in multiple projects over five years.
AI-written summary · about
chapters (16)
- 0:00Intro
- 5:06About Python
- 6:02Test Driven Development
- 7:38A code without test is broken by design
- 8:12Test as real users
- 8:46Server Status
- 10:01Broadcast Message
- 12:33Unit Tests
- 14:16Questions
- 14:57Challenges
- 17:49What is Wiremock
- 18:40More about Wiremock
- 21:09How to mock requests
- 24:28Endtoend tests
- 28:03Debugging
- 29:42QA
