示例#1
0
 def test_to_query(self):
     query = InQueryOperator()
     expect(query).not_to_be_null()
     expect(query.to_query("field_name", [10, 20])).to_be_like(
         {"field_name": {
             "$in": [10, 20]
         }})
示例#2
0
    def test_get_value(self):
        field = UUIDField()
        query = InQueryOperator()

        uuid1 = uuid4()
        uuid2 = uuid4()

        expect(query.get_value(field, [str(uuid1), str(uuid2)])).to_be_like(
            [uuid1, uuid2])