'Testing GeoJSON output from the database using GeoQuerySet.geojson().'

def test03c_geojson(self):

    if (not connection.ops.geojson):
        self.assertRaises(NotImplementedError, Country.objects.all().geojson, field_name='mpoly')
        return
    if (connection.ops.spatial_version >= (1, 4, 0)):
        pueblo_json = '{"type":"Point","coordinates":[-104.609252,38.255001]}'
        houston_json = '{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[-95.363151,29.763374]}'
        victoria_json = '{"type":"Point","bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],"coordinates":[-123.305196,48.462611]}'
        chicago_json = '{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}'
    else:
        pueblo_json = '{"type":"Point","coordinates":[-104.60925200,38.25500100]}'
        houston_json = '{"type":"Point","crs":{"type":"EPSG","properties":{"EPSG":4326}},"coordinates":[-95.36315100,29.76337400]}'
        victoria_json = '{"type":"Point","bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],"coordinates":[-123.30519600,48.46261100]}'
        chicago_json = '{"type":"Point","crs":{"type":"EPSG","properties":{"EPSG":4326}},"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}'
    self.assertRaises(TypeError, City.objects.geojson, precision='foo')
    self.assertEqual(pueblo_json, City.objects.geojson().get(name='Pueblo').geojson)
    self.assertEqual(houston_json, City.objects.geojson(crs=True, model_att='json').get(name='Houston').json)
    self.assertEqual(victoria_json, City.objects.geojson(bbox=True).get(name='Victoria').geojson)
    self.assertEqual(chicago_json, City.objects.geojson(bbox=True, crs=True, precision=5).get(name='Chicago').geojson)
