ShelterApp / AddResources

http://shelterapp.org/
11 stars 10 forks source link

slight regex change, tests to prove utils works #77

Open picklesueat opened 3 years ago

picklesueat commented 3 years ago

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)

picklesueat commented 3 years ago

Couldn't mock because mongomock doesn't have $text $search implemented

prabhushrikant commented 3 years ago

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.