~ubuntu-branches/debian/sid/social-auth-core/sid

« back to all changes in this revision

Viewing changes to social_core/tests/backends/test_chatwork.py

  • Committer: Package Import Robot
  • Author(s): Andre Bianchi
  • Date: 2018-02-22 19:49:12 UTC
  • Revision ID: package-import@ubuntu.com-20180222194912-4lqv8mlhnqc4ncd3
Tags: upstream-1.7.0
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import json
 
2
 
 
3
from .oauth import OAuth2Test
 
4
 
 
5
 
 
6
class ChatworkOAuth2Test(OAuth2Test):
 
7
    backend_path = 'social_core.backends.chatwork.ChatworkOAuth2'
 
8
    user_data_url = 'https://api.chatwork.com/v2/me'
 
9
    expected_username = 'hogehoge'
 
10
    access_token_body = json.dumps({
 
11
        'access_token': 'pyopyopyopyopyopyopyopyopyopyo',
 
12
        'token_type': 'Bearer',
 
13
        'expires_in': '1501138041000',
 
14
        'refresh_token': 'pyopyopyopyopyopyo',
 
15
        'scope': 'rooms.all:read_write'
 
16
    })
 
17
 
 
18
    user_data_body = json.dumps({
 
19
        'account_id': 123,
 
20
        'room_id': 322,
 
21
        'name': 'Foo Bar',
 
22
        'chatwork_id': 'hogehoge',
 
23
        'organization_id': 101,
 
24
        'organization_name': 'Foo foobar',
 
25
        'department': 'Support',
 
26
        'title': 'CMO',
 
27
        'url': 'http://www.example.com',
 
28
        'introduction': '',
 
29
        'mail': 'hogehoge@example.com',
 
30
        'tel_organization': '',
 
31
        'tel_extension': '',
 
32
        'tel_mobile': '',
 
33
        'skype': '',
 
34
        'facebook': '',
 
35
        'twitter': '',
 
36
        'avatar_image_url': 'https://www.example.com/hogehoge.jpg',
 
37
        'login_mail': 'hogehoge@example.com'
 
38
    })
 
39
 
 
40
    def test_login(self):
 
41
        self.do_login()
 
42
 
 
43
    def test_partial_pipeline(self):
 
44
        self.do_partial_pipeline()