Ticket #16409: 16409.diff

File 16409.diff, 990 bytes (added by Aymeric Augustin, 12 years ago)
  • django/contrib/gis/tests/geoapp/test_regress.py

     
    44
    55from django.contrib.gis.tests.utils import no_mysql, no_spatialite
    66from django.contrib.gis.shortcuts import render_to_kmz
     7from django.db.models import Count
    78from django.test import TestCase
    89
    910from .models import City, PennsylvaniaCity, State
     
    5859
    5960         # .count() should not throw TypeError in __eq__
    6061         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)
Back to Top