

@no_mysql
def test_unionagg(self):
    'Testing the `unionagg` (aggregate union) GeoQuerySet method.'
    tx = Country.objects.get(name='Texas').mpoly
    union1 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)')
    union2 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)')
    qs = City.objects.filter(point__within=tx)
    self.assertRaises(TypeError, qs.unionagg, 'name')
    u1 = qs.unionagg(field_name='point')
    u2 = qs.order_by('name').unionagg()
    tol = 1e-05
    if oracle:
        union = union2
    else:
        union = union1
    union.assertEqual(True, union.equals_exact(u1, tol))
    self.assertEqual(True, union.equals_exact(u2, tol))
    qs = City.objects.filter(name='NotACity')
    self.assertEqual(None, qs.unionagg(field_name='point'))

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/tests/geoapp/tests.py GeoQuerySetTest.test_unionagg/VarMisuse@117/229 `self`->`union`