MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / test_within

Method test_within

test_haystack/test_managers.py:123–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

121
122 @unittest.skipUnless(HAVE_GDAL, "Requires gdal library")
123 def test_within(self):
124 # This is a meaningless query but we're just confirming that the manager updates the parameters here:
125 p1 = Point(-90, -90)
126 p2 = Point(90, 90)
127 sqs = self.search_index.objects.within("location", p1, p2)
128 self.assertTrue(isinstance(sqs, SearchQuerySet))
129
130 params = sqs.query.build_params()
131
132 self.assertIn("within", params)
133 self.assertDictEqual(
134 params["within"], {"field": "location", "point_1": p1, "point_2": p2}
135 )
136
137 @unittest.skipUnless(HAVE_GDAL, "Requires gdal library")
138 def test_dwithin(self):

Callers

nothing calls this directly

Calls 2

withinMethod · 0.45
build_paramsMethod · 0.45

Tested by

no test coverage detected