@@ -603,6 +603,36 @@ def test__normalize_cursor_as_dict_hit(self):
603603
604604 self .assertEqual (query ._normalize_cursor (cursor , query ._orders ), ([1 ], True ))
605605
606+ def test__normalize_cursor_w___name___w_slash (self ):
607+ db_string = "projects/my-project/database/(default)"
608+ client = mock .Mock (spec = ["_database_string" ])
609+ client ._database_string = db_string
610+ parent = mock .Mock (spec = ["_path" , "_client" ])
611+ parent ._client = client
612+ parent ._path = ["C" ]
613+ query = self ._make_one (parent ).order_by ("__name__" , "ASCENDING" )
614+ expected = "{}/C/b" .format (db_string )
615+ cursor = ([expected ], True )
616+
617+ self .assertEqual (
618+ query ._normalize_cursor (cursor , query ._orders ), ([expected ], True )
619+ )
620+
621+ def test__normalize_cursor_w___name___wo_slash (self ):
622+ db_string = "projects/my-project/database/(default)"
623+ client = mock .Mock (spec = ["_database_string" ])
624+ client ._database_string = db_string
625+ parent = mock .Mock (spec = ["_path" , "_client" ])
626+ parent ._client = client
627+ parent ._path = ["C" ]
628+ query = self ._make_one (parent ).order_by ("__name__" , "ASCENDING" )
629+ cursor = (["b" ], True )
630+ expected = "{}/C/b" .format (db_string )
631+
632+ self .assertEqual (
633+ query ._normalize_cursor (cursor , query ._orders ), ([expected ], True )
634+ )
635+
606636 def test__to_protobuf_all_fields (self ):
607637 from google .protobuf import wrappers_pb2
608638 from google .cloud .firestore_v1beta1 .gapic import enums
0 commit comments