'Ensure "min_distace" and "max_distance" operators work well
together with the "near" operator in a 2dsphere index.'

@needs_mongodb_v3
def test_2dsphere_near_and_min_max_distance(self):

    (event1, event2, event3) = self._create_event_data(point_field_class=PointField)
    events = self.Event.objects(location__near=[(-87.67892), 41.9120459], location__min_distance=1000, location__max_distance=10000).order_by('-date')
    self.assertEqual(events.count(), 1)
    self.assertEqual(events[0], event3)
    events = self.Event.objects(location__near=[(-87.67892), 41.9120459], location__min_distance=10000).order_by('-date')
    self.assertEqual(events.count(), 1)
    self.assertEqual(events[0], event2)
