Adds a test for ``QuerySet.aggregate`` invalidation.