11from ravendb .documents .operations .compare_exchange .operations import PutCompareExchangeValueOperation
2- from ravendb .documents .session . misc import CmpXchg
2+ from ravendb .documents .queries . raven_document_query import RavenDocumentQuery
33from ravendb .infrastructure .entities import User
44from ravendb .tests .test_base import TestBase
55
@@ -27,8 +27,8 @@ def test_query_cmp_xchg_where(self):
2727 with self .store .open_session () as session :
2828 q = (
2929 session .advanced .document_query (object_type = User )
30- .where_equals ("name" , CmpXchg . value ("Hera" ))
31- .where_equals ("last_name" , CmpXchg . value ("Tom" ))
30+ .where_equals ("name" , RavenDocumentQuery . cmp_xchg ("Hera" ))
31+ .where_equals ("last_name" , RavenDocumentQuery . cmp_xchg ("Tom" ))
3232 )
3333
3434 self .assertEqual ("from 'Users' where name = cmpxchg($p0) and last_name = cmpxchg($p1)" , q .index_query .query )
@@ -38,7 +38,9 @@ def test_query_cmp_xchg_where(self):
3838 self .assertEqual ("Zeus" , query_result [0 ].name )
3939
4040 user = list (
41- session .advanced .document_query (object_type = User ).where_not_equals ("name" , CmpXchg .value ("Hera" ))
41+ session .advanced .document_query (object_type = User ).where_not_equals (
42+ "name" , RavenDocumentQuery .cmp_xchg ("Hera" )
43+ )
4244 )
4345 self .assertEqual (1 , len (user ))
4446
0 commit comments