diff --git a/django/contrib/gis/tests/layermap/tests.py b/django/contrib/gis/tests/layermap/tests.py index 5a0d15247e..2461c7be8c 100644 --- a/django/contrib/gis/tests/layermap/tests.py +++ b/django/contrib/gis/tests/layermap/tests.py @@ -294,7 +294,7 @@ class LayerMapTest(TestCase): lm = LayerMapping(City, city_shp, mapping) lm.save(silent=True, strict=True) self.assertEqual(City.objects.count(), 3) - self.assertEqual(City.objects.all().order_by('name_txt')[0].name_txt, "Houston") + self.assertEqual(City.objects.get(name='Houston').name_txt, "Houston") def test_encoded_name(self): """ Test a layer containing utf-8-encoded name """