Ticket #16409: 16409.diff
File 16409.diff, 990 bytes (added by , 13 years ago) |
---|
-
django/contrib/gis/tests/geoapp/test_regress.py
4 4 5 5 from django.contrib.gis.tests.utils import no_mysql, no_spatialite 6 6 from django.contrib.gis.shortcuts import render_to_kmz 7 from django.db.models import Count 7 8 from django.test import TestCase 8 9 9 10 from .models import City, PennsylvaniaCity, State … … 58 59 59 60 # .count() should not throw TypeError in __eq__ 60 61 self.assertEqual(cities_within_state.count(), 1) 62 63 def test06_defer_or_only_with_annotate(self): 64 "Regression for #16409 - make sure defer() and only() work with annotate()" 65 self.assertIsInstance(list(City.objects.annotate(Count('point')).defer('name')), list) 66 self.assertIsInstance(list(City.objects.annotate(Count('point')).only('name')), list)