@@ -416,8 +416,8 @@ def test_next_page_no_cursors_no_more_w_offset_and_limit(self):
416416 self .assertEqual (connection ._called_with , [EXPECTED ])
417417
418418 def test_next_page_w_cursors_w_more (self ):
419- from base64 import b64decode
420- from base64 import b64encode
419+ from base64 import urlsafe_b64decode
420+ from base64 import urlsafe_b64encode
421421 from gcloud .datastore .query import _pb_from_query
422422 connection = _Connection ()
423423 client = self ._makeClient (connection )
@@ -428,19 +428,19 @@ def test_next_page_w_cursors_w_more(self):
428428 iterator ._end_cursor = self ._END
429429 entities , more_results , cursor = iterator .next_page ()
430430
431- self .assertEqual (cursor , b64encode (self ._END ))
431+ self .assertEqual (cursor , urlsafe_b64encode (self ._END ))
432432 self .assertTrue (more_results )
433433 self .assertTrue (iterator ._more_results )
434434 self .assertEqual (iterator ._end_cursor , None )
435- self .assertEqual (b64decode (iterator ._start_cursor ), self ._END )
435+ self .assertEqual (urlsafe_b64decode (iterator ._start_cursor ), self ._END )
436436 self .assertEqual (len (entities ), 1 )
437437 self .assertEqual (entities [0 ].key .path ,
438438 [{'kind' : self ._KIND , 'id' : self ._ID }])
439439 self .assertEqual (entities [0 ]['foo' ], u'Foo' )
440440 qpb = _pb_from_query (query )
441441 qpb .offset = 0
442- qpb .start_cursor = b64decode (self ._START )
443- qpb .end_cursor = b64decode (self ._END )
442+ qpb .start_cursor = urlsafe_b64decode (self ._START )
443+ qpb .end_cursor = urlsafe_b64decode (self ._END )
444444 EXPECTED = {
445445 'dataset_id' : self ._DATASET ,
446446 'query_pb' : qpb ,
0 commit comments