diff --git a/tests/gis_tests/distapp/models.py b/tests/gis_tests/distapp/models.py
index fcad6fc097..1971741c54 100644
a
|
b
|
class AustraliaCity(NamedModel):
|
28 | 28 | "City model for Australia, using WGS84." |
29 | 29 | point = models.PointField() |
30 | 30 | radius = models.IntegerField(default=10000) |
| 31 | allowed_distance = models.FloatField(default=0.5) |
31 | 32 | |
32 | 33 | |
33 | 34 | class CensusZipcode(NamedModel): |
diff --git a/tests/gis_tests/distapp/tests.py b/tests/gis_tests/distapp/tests.py
index d84e829868..0c1c992614 100644
a
|
b
|
class DistanceTest(TestCase):
|
234 | 234 | ).filter(annotated_value=True) |
235 | 235 | self.assertEqual(self.get_names(qs), ['77002', '77025', '77401']) |
236 | 236 | |
| 237 | @skipUnlessDBFeature('supports_dwithin_lookup') |
| 238 | def test_dwithin_with_expression_rhs(self): |
| 239 | # LineString of Wollongong and Adelaide coords. |
| 240 | ls = LineString(((150.902, -34.4245), (138.6, -34.9258)), srid=4326) |
| 241 | qs = AustraliaCity.objects.filter( |
| 242 | point__dwithin=(ls, F('allowed_distance')), |
| 243 | ).order_by('name') |
| 244 | self.assertEqual( |
| 245 | self.get_names(qs), |
| 246 | ['Adelaide', 'Mittagong', 'Shellharbour', 'Thirroul', 'Wollongong'], |
| 247 | ) |
237 | 248 | |
238 | 249 | ''' |
239 | 250 | ============================= |