The tools available in Django REST Framework allow rapid development of web APIs, and it's easy-to-use wrappers around Django and Python's testing toolkit make it easy to include a comprehensive test suite in any application. This is for folks new to DRF & testing in general.
Test-driven development (TDD) allows developers to begin with the end in mind. In this talk, we’ll cover the basics of using TDD to develop a web API with the popular Django REST Framework. Attendees will receive a quick overview of both TDD and DRF from which they can continue to explore.
We’ll begin with an outside-in integration test that describes an entire application endpoint. Then we’ll use test-first principles to fill in the missing functionality by writing unit tests that fail before writing URLs, views, serializers, and models. We’ll end with a refactor to make the code more readable, safely improving the code while our test suite ensures the features stay intact.