def test_or(self): statuses = ['good', 'bad'] params = { 'status': statuses } converted = mongodb.params_to_mongo(params) self.assertEqual(converted['status'], {'$in': statuses})
def test_or(self): statuses = ['good', 'bad'] params = {'status': statuses} converted = mongodb.params_to_mongo(params) self.assertEqual(converted['status'], {'$in': statuses})
def test_blank(self): self.assertEqual(mongodb.params_to_mongo(None), {}) self.assertEqual(mongodb.params_to_mongo({}), {}) self.assertEqual(mongodb.params_to_mongo([]), {})