'Testing the `distance_lt`, `distance_gt`, `distance_lte`, and `distance_gte` lookup types.'

def test04_distance_lookups(self):

    qs1 = SouthTexasCity.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(point__distance_lte=(self.stx_pnt, D(km=20)))
    if (spatialite or oracle):
        dist_qs = (qs1,)
    else:
        qs2 = SouthTexasCityFt.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(point__distance_lte=(self.stx_pnt, D(km=20)))
        dist_qs = (qs1, qs2)
    for qs in dist_qs:
        cities = self.get_names(qs)
        self.assertEqual(cities, ['Bellaire', 'Pearland', 'West    University    Place'])
    z = SouthTexasZipcode.objects.get(name='77005')
    qs = SouthTexasZipcode.objects.exclude(name='77005').filter(poly__distance_lte=(z.poly, D(m=275)))
    self.assertEqual(['77025', '77401'], self.get_names(qs))
    qs = SouthTexasZipcode.objects.exclude(name='77005').filter(poly__distance_lte=(z.poly, D(m=300)))
    self.assertEqual(['77002', '77025', '77401'], self.get_names(qs))
