def test16_annotated_date_queryset(self):
        birth_years = [dt.year for dt in
                       list(Author.objects.annotate(num_books=Count('books')).dates('dob', 'year'))]
        birth_years.sort()
        self.assertEqual([1950, 1974], birth_years)

    # TODO: Related tests for KML, GML, and distance lookups.
Ensure annotated date querysets work if spatial backend is used.  See #14648.
dataset/ETHPy150Open django/django/tests/gis_tests/relatedapp/tests.py/RelatedGeoModelTest.test16_annotated_date_queryset