#NEWLINE# def test_set_cookie_encoded( self ) : #NEWLINE# #INDENT# with self . _get_app ( ) . get_test_context ( ) as request : #NEWLINE# #INDENT# store = request . session_store #NEWLINE# store . set_cookie ( 'foo' , 'bar' , format = 'json' ) #NEWLINE# store . set_cookie ( 'baz' , 'ding' , format = 'json' ) #NEWLINE# response = Response ( ) #NEWLINE# store . save ( response ) #NEWLINE# #UNINDENT# headers = { #NEWLINE# #INDENT# 'Cookie' : '\n' . join ( response . headers . getlist ( 'Set-Cookie' ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# with self . _get_app ( ) . get_test_context ( '/' , headers = headers ) as request : #NEWLINE# #INDENT# store = request . session_store #NEWLINE# self . assertEqual ( json_b64decode ( request . cookies . get ( 'foo' ) ) , 'bar' ) #NEWLINE# self . assertEqual ( json_b64decode ( request . cookies . get ( 'baz' ) ) , 'ding' )