'Testing GML output from the database using GeoQuerySet.gml().'

def test_gml(self):

    if (mysql or (spatialite and (not connection.ops.gml))):
        self.assertRaises(NotImplementedError, Country.objects.all().gml, field_name='mpoly')
        return
    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:
        gml_regex = re.compile('^<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))):
        gml_regex = re.compile('^<gml:Point    SrsName="EPSG::4326"><gml:coordinates    decimal="\\."    cs=","    ts="    ">-104.609251\\d+,38.255001</gml:coordinates></gml:Point>')
    else:
        gml_regex = re.compile('^<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))
    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)
