def METHOD_NAME(self, search_model, model):
    """Test that the fields in a search model (e.g. SearchWaypoint) match
    the fields in the corresponding model (e.g. Waypoint).
    """
    fields = search_model.FIELDS
    mapping_fields = search_model._doc_type.mapping
    for field in fields:
        self.assertTrue(hasattr(model, field))
        self.assertIn(field, mapping_fields)
        mapping_field = mapping_fields[field]
        if isinstance(mapping_field, QueryableMixin):
            if hasattr(mapping_field, '_model_field'):
                self.assertTrue(
                    mapping_field._model_field is getattr(model, field))
            if hasattr(mapping_field, '_enum_range'):
                self.assertFalse(
                    mapping_field._enum_range,
                    'Field {0} should be listed as ENUM_RANGE_FIELDS'.
                    format(field)
                )
    enum_range_fields = search_model.ENUM_RANGE_FIELDS \
        if hasattr(search_model, 'ENUM_RANGE_FIELDS') else []
    for field in enum_range_fields:
        self.assertTrue(hasattr(model, field))
        self.assertIn(field, mapping_fields)
        mapping_field = mapping_fields[field]
        if isinstance(mapping_field, QueryableMixin):
            if hasattr(mapping_field, '_model_field'):
                self.assertTrue(
                    mapping_field._model_field is getattr(model, field))
    queryable_fields = search_model.queryable_fields
    self.assertIn('qa', queryable_fields)
    self.assertTrue(queryable_fields['qa']._enum)
    self.assertIn('l', queryable_fields)
    self.assertTrue(queryable_fields['l']._enum)
    self.assertIn('a', queryable_fields)
    self.assertTrue(queryable_fields['a']._is_id)