'Testing the \'left\' and \'right\' lookup types.'

@no_mysql
@no_oracle
@no_spatialite
def test_left_right_lookups(self):

    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))
