Open picklesueat opened 3 years ago
Couldn't mock because mongomock doesn't have $text $search implemented
Couldn't mock because mongomock doesn't have $text $search implemented
Thats true, will have to do integration test as you are doing. Please be sure of cleaning up the collections you create as part of your integration tests.
Looks like utils works correctly, I thought "coll.find_one( {"$text": {"$search": ' '.join(grammed_name)}, 'zip': zipcode} )" would search using logical or until it found the first ngram match, but it seems to actually find the closest match (longest string) if anyone can confirm that would be awesome, but it looks like the tests prove it.
Also made a slight regex change, and wrote corresponding test to show why (not sure how I should link those two things to make it easy to review)