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