def get_all_matching(cls, column_name, values):
    """Get all the instances of ``cls`` where the column called ``column_name``
      matches one of the ``values`` provided.
      
      Setup::
      
          >>> from mock import Mock
          >>> mock_cls = Mock()
          >>> mock_cls.query.filter.return_value.all.return_value = ['result']
      
      Queries and returns the results::
      
          >>> get_all_matching(mock_cls, 'a', [1,2,3])
          ['result']
          >>> mock_cls.a.in_.assert_called_with([1,2,3])
          >>> mock_cls.query.filter.assert_called_with(mock_cls.a.in_.return_value)
      
    """
    
    column = getattr(cls, column_name)
    query = cls.query.filter(column.in_(values))
    return query.all()