#NEWLINE# @ patch ( 'time.time' ) #NEWLINE# @ patch ( 'requests.post' ) #NEWLINE# def test_provider_returns_checkout_url( self , mocked_post , mocked_time ) : #NEWLINE# #INDENT# code = '123abc' #NEWLINE# signature = '21d476eff7b2e6cccdfe6deb0c097ba638d5de7e775b303e4fdb2f8bfeff72e2' #NEWLINE# url = ( 'https://sandbox.coinbase.com/checkouts/%s' % code ) #NEWLINE# post = MagicMock ( ) #NEWLINE# post . json = MagicMock ( return_value = { #NEWLINE# #INDENT# 'button' : { #NEWLINE# #INDENT# 'code' : code , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# post . status_code = 200 #NEWLINE# mocked_post . return_value = post #NEWLINE# mocked_time . return_value = 1 #NEWLINE# form = self . provider . get_form ( self . payment ) #NEWLINE# self . assertEqual ( form . action , code ) #NEWLINE# self . assertEqual ( mocked_post . call_args [ 1 ] [ 'headers' ] [ 'ACCESS_SIGNATURE' ] , signature )