Adds a test for prefetch_related invalidation.