Ensure that indexes are created automatically for GeoPointFields.
(self)
| 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.""" |
nothing calls this directly
no test coverage detected