How to test django caching?
Mock the view, hit the page, and see if the mock was called. if it was not, the cache was used instead.
Is there a way to be sure that a page is coming from cache on a production server and on the development server as well?
The solution shouldn't involve caching middleware because not every project uses them. Though the solution itself might be a middleware.
Just checking if the data is stale is not a very safe testing method IMO.