MCPcopy Create free account
hub / github.com/MongoEngine/mongoengine / test_indexes_2dsphere

Method test_indexes_2dsphere

tests/fields/test_geo_fields.py:318–330  ·  view source on GitHub ↗

Ensure that indexes are created automatically for GeoPointFields.

(self)

Source from the content-addressed store, hash-verified

316 assert geo_indicies == [{"fields": [("venue.location", "2d")]}]
317
318 def test_indexes_2dsphere(self):
319 """Ensure that indexes are created automatically for GeoPointFields."""
320
321 class Event(Document):
322 title = StringField()
323 point = PointField()
324 line = LineStringField()
325 polygon = PolygonField()
326
327 geo_indicies = Event._geo_indices()
328 assert {"fields": [("line", "2dsphere")]} in geo_indicies
329 assert {"fields": [("polygon", "2dsphere")]} in geo_indicies
330 assert {"fields": [("point", "2dsphere")]} in geo_indicies
331
332 def test_indexes_2dsphere_embedded(self):
333 """Ensure that indexes are created automatically for GeoPointFields."""

Callers

nothing calls this directly

Calls 1

_geo_indicesMethod · 0.80

Tested by

no test coverage detected