File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -269,15 +269,15 @@ def to_string(self):
269
269
The resulting string includes the token's secret, so you should never
270
270
send or store this string where a third party can read it.
271
271
"""
272
-
273
- data = {
274
- 'oauth_token' : self .key ,
275
- 'oauth_token_secret' : self .secret ,
276
- }
272
+ items = [
273
+ ('oauth_token' , self .key ),
274
+ ('oauth_token_secret' , self .secret ),
275
+ ]
277
276
278
277
if self .callback_confirmed is not None :
279
- data ['oauth_callback_confirmed' ] = self .callback_confirmed
280
- return urlencode (data )
278
+ items .append (
279
+ ('oauth_callback_confirmed' , self .callback_confirmed ))
280
+ return urlencode (items )
281
281
282
282
@staticmethod
283
283
def from_string (s ):
Original file line number Diff line number Diff line change @@ -215,8 +215,8 @@ def test_get_callback_url(self):
215
215
self .assertEqual (url , '%s%s' % (cb , verifier_str ))
216
216
217
217
def test_to_string (self ):
218
- string = 'oauth_token_secret =%s&oauth_token =%s' % (self . secret ,
219
- self .key )
218
+ string = 'oauth_token =%s&oauth_token_secret =%s' % (
219
+ self .key , self . secret )
220
220
self .assertEqual (self .token .to_string (), string )
221
221
222
222
self .token .set_callback ('http://www.example.com/my-callback' )
@@ -236,7 +236,7 @@ def _compare_tokens(self, new):
236
236
def test___str__ (self ):
237
237
tok = oauth .Token ('tooken' , 'seecret' )
238
238
self .assertEqual (str (tok ),
239
- 'oauth_token_secret=seecret& oauth_token=tooken' )
239
+ 'oauth_token=tooken&oauth_token_secret=seecret ' )
240
240
241
241
def test_from_string (self ):
242
242
self .assertRaises (ValueError , lambda : oauth .Token .from_string ('' ))
You can’t perform that action at this time.
0 commit comments