      def test_geojson(self):
          "Testing GeoJSON output from the database using GeoQuerySet.geojson()."
          # Only PostGIS and SpatiaLite support GeoJSON.
          if not connection.ops.geojson:
              self.assertRaises(NotImplementedError, Country.objects.all().geojson, field_name='mpoly')
              return
  
          pueblo_json = '{"type":"Point","coordinates":[-104.609252,38.255001]}'
          houston_json = (
              '{"type":"Point","crs":{"type":"name","properties":'
 
</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(TypeError, qs.kml, 'name')
 </s> add         with self.assertRaises(TypeError):
            qs.kml('name') </s> remove         self.assertRaises(TypeError, City.objects.svg, precision='foo')
 </s> add         with self.assertRaises(TypeError):
            City.objects.svg(precision='foo') </s> remove         self.assertRaises(ValueError, d.save)
        # ValueError: MySQL backend does not support timezone-aware datetimes.
 </s> add         # MySQL backend does not support timezone-aware datetimes.
        with self.assertRaises(ValueError):
            d.save() </s> remove         self.assertRaises(ObjectDoesNotExist, Site.objects.get_current)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            Site.objects.get_current()
            with self.assertRaises(NotImplementedError):
                Country.objects.all().geojson(field_name='mpoly')
      def test_geojson(self):
          "Testing GeoJSON output from the database using GeoQuerySet.geojson()."
          # Only PostGIS and SpatiaLite support GeoJSON.
          if not connection.ops.geojson:
            with self.assertRaises(NotImplementedError):
                Country.objects.all().geojson(field_name='mpoly')
              return
  
          pueblo_json = '{"type":"Point","coordinates":[-104.609252,38.255001]}'
          houston_json = (
              '{"type":"Point","crs":{"type":"name","properties":'
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