def test_gml(self):
        if mysql or (spatialite and not connection.ops.gml) :
            self.assertRaises(NotImplementedError, Country.objects.all().gml, field_name='mpoly')
            return

        # Should throw a TypeError when tyring to obtain GML from a
        # non-geometry field.
        qs = City.objects.all()
        self.assertRaises(TypeError, qs.gml, field_name='name')
        ptown1 = City.objects.gml(field_name='point', precision=9).get(name='Pueblo')
        ptown2 = City.objects.gml(precision=9).get(name='Pueblo')

        if oracle:
            # No precision parameter for Oracle :-/
            gml_regex = re.compile(r'^<gml:Point srsName="SDO:4326" xmlns:gml="http://www.opengis.net/gml"><gml:coordinates decimal="\." cs="," ts=" ">-104.60925\d+,38.25500\d+ </gml:coordinates></gml:Point>')
        elif spatialite and connection.ops.spatial_version < (3, 0, 0):
            # Spatialite before 3.0 has extra colon in SrsName
            gml_regex = re.compile(r'^<gml:Point SrsName="EPSG::4326"><gml:coordinates decimal="\." cs="," ts=" ">-104.609251\d+,38.255001</gml:coordinates></gml:Point>')
        else:
            gml_regex = re.compile(r'^<gml:Point srsName="EPSG:4326"><gml:coordinates>-104\.60925\d+,38\.255001</gml:coordinates></gml:Point>')

        for ptown in [ptown1, ptown2]:
            self.assertTrue(gml_regex.match(ptown.gml))

        # PostGIS < 1.5 doesn't include dimension im GMLv3 output.
        if postgis and connection.ops.spatial_version >= (1, 5, 0):
            self.assertIn('<gml:pos srsDimension="2">',
                          City.objects.gml(version=3).get(name='Pueblo').gml)
Testing GML output from the database using GeoQuerySet.gml().
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/tests/geoapp/tests.py/GeoQuerySetTest.test_gml