#NEWLINE# def test_grant_open_access_to_location( self ) : #NEWLINE# #INDENT# location = self . add_location ( ) #NEWLINE# self . assertTrue ( ( 'openAccess' not in location ) ) #NEWLINE# open_access_url = ( location [ 'self' ] + 'open-access/' ) #NEWLINE# put_response = self . put ( open_access_url , { #NEWLINE# #INDENT# 'requireLogin' : False , #NEWLINE# #UNINDENT# } ) #NEWLINE# parsed_response_body = json . loads ( put_response . content ) #NEWLINE# self . assertEqual ( 201 , put_response . status_code ) #NEWLINE# self . assertEqual ( open_access_url , put_response [ 'Location' ] ) #NEWLINE# self . assertEqual ( open_access_url , parsed_response_body [ 'self' ] ) #NEWLINE# self . assertFalse ( parsed_response_body [ 'requireLogin' ] ) #NEWLINE# location = json . loads ( self . get ( location [ 'self' ] ) . content ) #NEWLINE# self . assertTrue ( ( 'openAccess' in location ) ) #NEWLINE# self . assertFalse ( location [ 'openAccess' ] [ 'requireLogin' ] )