Beispiel #1
0
 def _prepare_request(self, request, token=None):
     request.set_parameter(OAuthParameters.SIGNATURE_METHOD,
                           self.signature_method.get_name())
     request.set_parameter(OAuthParameters.NONCE, oauth.generate_nonce())
     request.set_parameter(OAuthParameters.TIMESTAMP,
                           oauth.generate_timestamp())
     request.sign_request(self.signature_method, self.consumer, token)
 def _prepare_request(self, request, token = None):
   request.set_parameter(OAuthParameters.SIGNATURE_METHOD, 
                         self.signature_method.get_name())
   request.set_parameter(OAuthParameters.NONCE, oauth.generate_nonce())
   request.set_parameter(OAuthParameters.TIMESTAMP, 
                         oauth.generate_timestamp())
   request.sign_request(self.signature_method, self.consumer, token)
Beispiel #3
0
 def test_generate_nonce(self):
     DEFAULT_NONCE_LENGTH = 8
     self.assertTrue(len(oauth.generate_nonce()) is DEFAULT_NONCE_LENGTH)
     self.assertTrue(type(oauth.generate_nonce()) is type(''))
 def test_generate_nonce(self):
   DEFAULT_NONCE_LENGTH = 8
   self.assertTrue(len(oauth.generate_nonce()) is DEFAULT_NONCE_LENGTH)
   self.assertTrue(type(oauth.generate_nonce()) is type(''))