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

Method test_indexes_geopoint

tests/fields/test_geo_fields.py:292–300  ·  view source on GitHub ↗

Ensure that indexes are created automatically for GeoPointFields.

(self)

Source from the content-addressed store, hash-verified

290 Location(loc=[[[[1, 2], [3, 4], [5, 6], [1, 2]]]]).validate()
291
292 def test_indexes_geopoint(self):
293 """Ensure that indexes are created automatically for GeoPointFields."""
294
295 class Event(Document):
296 title = StringField()
297 location = GeoPointField()
298
299 geo_indicies = Event._geo_indices()
300 assert geo_indicies == [{"fields": [("location", "2d")]}]
301
302 def test_geopoint_embedded_indexes(self):
303 """Ensure that indexes are created automatically for GeoPointFields on

Callers

nothing calls this directly

Calls 1

_geo_indicesMethod · 0.80

Tested by

no test coverage detected