'Testing the `point_on_surface` GeoQuerySet method.'

@no_mysql
def test_point_on_surface(self):

    if oracle:
        ref = {'New    Zealand': fromstr('POINT    (174.616364    -36.100861)', srid=4326), 'Texas': fromstr('POINT    (-103.002434    36.500397)', srid=4326)}
    elif (postgis or spatialite):
        ref = {'New    Zealand': Country.objects.get(name='New    Zealand').mpoly.point_on_surface, 'Texas': Country.objects.get(name='Texas').mpoly.point_on_surface}
    for c in Country.objects.point_on_surface():
        if spatialite:
            tol = 1e-05
        else:
            tol = 1e-09
        self.assertEqual(True, ref[c.name].equals_exact(c.point_on_surface, tol))
