

@no_mysql
@no_oracle
@no_spatialite
def test_left_right_lookups(self):
    "Testing the 'left' and 'right' lookup types."
    co_border = State.objects.get(name='Colorado').poly
    ks_border = State.objects.get(name='Kansas').poly
    cities = ['Houston', 'Dallas', 'Oklahoma City', 'Lawrence', 'Chicago', 'Wellington']
    qs = City.objects.filter(point__right=co_border)
    self.assertEqual(6, len(qs))
    for c in qs:
        self.assertEqual(True, (c.name in cities))
    cities = ['Chicago', 'Wellington']
    qs = City.objects.filter(point__right=ks_border)
    self.assertEqual(2, len(qs))
    for c in qs:
        self.assertEqual(True, (c.name in cities))
    vic = City.objects.get(point__left=co_border)
    self.assertEqual('Victoria', vic.name)
    cities = ['Pueblo', 'Victoria']
    qs = City.objects.filter(point__left=ks_border)
    self.assertEqual(2, len(qs))
    for c in qs:
        self.assertEqual(True, (c.name in cities))

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/tests/geoapp/tests.py GeoLookupTest.test_left_right_lookups/original