[Python-modules-commits] [python-social-auth] 142/322: Fix zotero tests

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:13:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.10
in repository python-social-auth.

commit 29bb6ed60c37c56f7f31babc4444e33dff17be30
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Mon Feb 23 13:54:08 2015 -0200

    Fix zotero tests
---
 social/backends/zotero.py            |  8 +++++---
 social/tests/backends/test_zotero.py | 14 ++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/social/backends/zotero.py b/social/backends/zotero.py
index 83d494b..3e54484 100644
--- a/social/backends/zotero.py
+++ b/social/backends/zotero.py
@@ -22,6 +22,8 @@ class ZoteroOAuth(BaseOAuth1):
 
     def get_user_details(self, response):
         """Return user details from Zotero API account"""
-        access_token = response.get('access_token', dict())
-        return {'username': access_token.get('username', ''),
-                'userID': access_token.get('userID', '')}
+        access_token = response.get('access_token', {})
+        return {
+            'username': access_token.get('username', ''),
+            'userID': access_token.get('userID', '')
+        }
diff --git a/social/tests/backends/test_zotero.py b/social/tests/backends/test_zotero.py
index f950760..e93aa0f 100644
--- a/social/tests/backends/test_zotero.py
+++ b/social/tests/backends/test_zotero.py
@@ -1,5 +1,3 @@
-import json
-
 from social.p3 import urlencode
 from social.tests.backends.oauth import OAuth1Test
 
@@ -7,12 +5,12 @@ from social.tests.backends.oauth import OAuth1Test
 class ZoteroOAuth1Test(OAuth1Test):
     backend_path = 'social.backends.zotero.ZoteroOAuth'
     expected_username = 'FooBar'
-    access_token_body = json.dumps({
-        'access_token': {u'oauth_token': u'foobar',
-                         u'oauth_token_secret': u'rodgsNDK4hLJU1504Atk131G',
-                         u'userID': u'123456_abcdef',
-                         u'username': u'anyusername'}})
-
+    access_token_body = urlencode({
+        'oauth_token': 'foobar',
+        'oauth_token_secret': 'rodgsNDK4hLJU1504Atk131G',
+        'userID': '123456_abcdef',
+        'username': 'FooBar'
+    })
     request_token_body = urlencode({
         'oauth_token_secret': 'foobar-secret',
         'oauth_token': 'foobar',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list