Adds a test for select_related invalidation.