@@ -459,6 +459,28 @@ def test__cursor_helper_w_snapshot_wrong_collection(self):
459459 with self .assertRaises (ValueError ):
460460 query ._cursor_helper (snapshot , False , False )
461461
462+ def test__cursor_helper_w_snapshot_other_collection_all_descendants (self ):
463+ values = {"a" : 7 , "b" : "foo" }
464+ docref = self ._make_docref ("there" , "doc_id" )
465+ snapshot = self ._make_snapshot (docref , values )
466+ collection = self ._make_collection ("here" )
467+ query1 = self ._make_one (collection , all_descendants = True )
468+
469+ query2 = query1 ._cursor_helper (snapshot , False , False )
470+
471+ self .assertIs (query2 ._parent , collection )
472+ self .assertIsNone (query2 ._projection )
473+ self .assertEqual (query2 ._field_filters , ())
474+ self .assertEqual (query2 ._orders , ())
475+ self .assertIsNone (query2 ._limit )
476+ self .assertIsNone (query2 ._offset )
477+ self .assertIsNone (query2 ._start_at )
478+
479+ cursor , before = query2 ._end_at
480+
481+ self .assertIs (cursor , snapshot )
482+ self .assertFalse (before )
483+
462484 def test__cursor_helper_w_snapshot (self ):
463485 values = {"a" : 7 , "b" : "foo" }
464486 docref = self ._make_docref ("here" , "doc_id" )
0 commit comments