[Python-modules-commits] [python-social-auth] 18/131: ADDED: test fot upwork backend

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:16:56 UTC 2016


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

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

commit 7af138e84cb80152eab2b8f711d80ae46fd6636e
Author: Shepilov Vladislav <shepilov.v at protonmail.com>
Date:   Wed Apr 20 05:50:57 2016 +0300

    ADDED: test fot upwork backend
    
    Signed-off-by: Shepilov Vladislav <shepilov.v at protonmail.com>
---
 social/tests/backends/test_upwork.py | 53 ++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/social/tests/backends/test_upwork.py b/social/tests/backends/test_upwork.py
new file mode 100644
index 0000000..8eb6d8d
--- /dev/null
+++ b/social/tests/backends/test_upwork.py
@@ -0,0 +1,53 @@
+import json
+
+from social.p3 import urlencode
+from social.tests.backends.oauth import OAuth1Test
+
+
+class UpworkOAuth1Test(OAuth1Test):
+    backend_path = 'social.backends.upwork.UpworkOAuth'
+    user_data_url = 'https://www.upwork.com/api/auth/v1/info.json'
+    expected_username = '10101010'
+    access_token_body = json.dumps({
+        'access_token': 'foobar',
+        'token_type': 'bearer'
+    })
+    request_token_body = urlencode({
+        'oauth_token_secret': 'foobar-secret',
+        'oauth_token': 'foobar',
+        'oauth_callback_confirmed': 'true'
+    })
+    user_data_body = json.dumps({
+        'info': {
+            'portrait_32_img': '',
+            'capacity': {
+                'buyer': 'no',
+                'affiliate_manager': 'no',
+                'provider': 'yes'
+            },
+            'company_url': '',
+            'has_agency': '1',
+            'portrait_50_img': '',
+            'portrait_100_img': '',
+            'location': {
+                'city': 'New York',
+                'state': '',
+                'country': 'USA'
+            },
+            'ref': '9755314',
+            'profile_url': 'https://www.upwork.com/users/~10101010'
+        },
+        'auth_user': {
+            'timezone': 'USA/New York',
+            'first_name': 'Foo',
+            'last_name': 'Bar',
+            'timezone_offset': '10000'
+        },
+        'server_time': '1111111111'
+    })
+
+    def test_login(self):
+        self.do_login()
+
+    def test_partial_pipeline(self):
+        self.do_partial_pipeline()

-- 
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