def test_ranking_based_on_shortest_match(completer):
 text = u'user'
 collection = [u'api_user', u'user_group']
 matches = completer.find_matches(text, collection)
 assert (matches[1].priority > matches[0].priority)

def test_ranking_based_on_shortest_match ( completer ) : text = u'user' collection = [ u'api_user' , u'user_group' ] matches = completer . find_matches ( text , collection ) assert ( matches [ 1 ] . priority > matches [ 0 ] . priority )
fuzzy result rank should be based on shortest match .