Statistics
| Branch: | Tag: | Revision:

root / social / tests / backends / test_tumblr.py @ a0a04c0a

History | View | Annotate | Download (1.7 kB)

1
import json
2

    
3
from social.p3 import urlencode
4
from social.tests.backends.oauth import OAuth1Test
5

    
6

    
7
class TumblrOAuth1Test(OAuth1Test):
8
    backend_path = 'social.backends.tumblr.TumblrOAuth'
9
    user_data_url = 'http://api.tumblr.com/v2/user/info'
10
    expected_username = 'foobar'
11
    access_token_body = json.dumps({
12
        'access_token': 'foobar',
13
        'token_type': 'bearer'
14
    })
15
    request_token_body = urlencode({
16
        'oauth_token_secret': 'foobar-secret',
17
        'oauth_token': 'foobar',
18
        'oauth_callback_confirmed': 'true'
19
    })
20
    user_data_body = json.dumps({
21
        'meta': {
22
            'status': 200,
23
            'msg': 'OK'
24
        },
25
        'response': {
26
            'user': {
27
                'following': 1,
28
                'blogs': [{
29
                    'updated': 0,
30
                    'description': '',
31
                    'drafts': 0,
32
                    'title': 'Untitled',
33
                    'url': 'http://foobar.tumblr.com/',
34
                    'messages': 0,
35
                    'tweet': 'N',
36
                    'share_likes': True,
37
                    'posts': 0,
38
                    'primary': True,
39
                    'queue': 0,
40
                    'admin': True,
41
                    'followers': 0,
42
                    'ask': False,
43
                    'facebook': 'N',
44
                    'type': 'public',
45
                    'facebook_opengraph_enabled': 'N',
46
                    'name': 'foobar'
47
                }],
48
                'default_post_format': 'html',
49
                'name': 'foobar',
50
                'likes': 0
51
            }
52
        }
53
    })
54

    
55
    def test_login(self):
56
        self.do_login()
57

    
58
    def test_partial_pipeline(self):
59
        self.do_partial_pipeline()