          "Testing KML output from the database using GeoQuerySet.kml()."
          # Should throw a TypeError when trying to obtain KML from a
          #  non-geometry field.
          qs = City.objects.all()
          self.assertRaises(TypeError, qs.kml, 'name')
  
          # Ensuring the KML is as expected.
          ptown1 = City.objects.kml(field_name='point', precision=9).get(name='Pueblo')
          ptown2 = City.objects.kml(precision=9).get(name='Pueblo')
          for ptown in [ptown1, ptown2]:
 
</s> remove         self.assertRaises(TypeError, qs.gml, field_name='name')
 </s> add         with self.assertRaises(TypeError):
            qs.gml(field_name='name') </s> remove             self.assertRaises(NotImplementedError, Country.objects.all().geojson, field_name='mpoly')
 </s> add             with self.assertRaises(NotImplementedError):
                Country.objects.all().geojson(field_name='mpoly') </s> remove         self.assertRaises(exception, force_text, MyString())
 </s> add         with self.assertRaises(exception):
            force_text(MyString()) </s> remove         self.assertRaises(ValueError, Country.objects.filter, mpoly__relate=(23, 'foo'))
 </s> add         with self.assertRaises(ValueError):
            Country.objects.filter(mpoly__relate=(23, 'foo')) </s> remove             self.assertRaises(GEOSException, fg._get_ptr)
 </s> add             with self.assertRaises(GEOSException):
                fg._get_ptr()
        with self.assertRaises(TypeError):
            qs.kml('name')
          "Testing KML output from the database using GeoQuerySet.kml()."
          # Should throw a TypeError when trying to obtain KML from a
          #  non-geometry field.
          qs = City.objects.all()
        with self.assertRaises(TypeError):
            qs.kml('name')
  
          # Ensuring the KML is as expected.
          ptown1 = City.objects.kml(field_name='point', precision=9).get(name='Pueblo')
          ptown2 = City.objects.kml(precision=9).get(name='Pueblo')
          for ptown in [ptown1, ptown2]:
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/geoapp/tests.py