From the course: Building React and Django Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Unit testing caching with Django REST framework

Unit testing caching with Django REST framework

From the course: Building React and Django Apps

Start my 1-month free trial

Unit testing caching with Django REST framework

- [Instructor] There's some caching being used in the wish list code. Let's write a test to make sure it's working properly. We start by creating a package for testing and we test to make sure the wish list cache starts as empty and we also need to check the API response to ensure that the wish list is empty there as well. Then we're going to add the package to the wish list by posting to the wish list API end point. The cache will be empty at this point and then we're going to retrieve the list and at this point the cache should have the package that we added in it. Now let's run the tests.

Contents