def test_q_with_valid_objectid(self): q = base.q({'_id': '0123456789abcdef01234567'}) h.assert_equal(q, {'$or': [{'_id': '0123456789abcdef01234567'}, {'_id': mongo.ObjectId('0123456789abcdef01234567')}]})
def test_q_with_other_keys(self): q = base.q({'_id': 'some_id', 'foo': 'bar'}) h.assert_equal(q, {'_id': 'some_id'})
def test_q_with_string(self): q = base.q({'_id': 'some_id'}) h.assert_equal(q, {'_id': 'some_id'})