Пример #1
0
 def make_elsewhere(self, platform, user_id, user_name, **kw):
     info = UserInfo( platform=platform
                    , user_id=unicode(user_id)
                    , user_name=user_name
                    , **kw
                    )
     return AccountElsewhere.upsert(info)
Пример #2
0
 def make_elsewhere(self, platform, user_id, user_name, **kw):
     info = UserInfo( platform=platform
                    , user_id=unicode(user_id)
                    , user_name=user_name
                    , **kw
                    )
     return AccountElsewhere.upsert(info)
Пример #3
0
 def make_elsewhere(self, platform, user_id, user_name, **kw):
     """Factory for :py:class:`~gratipay.models.account_elsewhere.AccountElsewhere`.
     """
     info = UserInfo(platform=platform,
                     user_id=unicode(user_id),
                     user_name=user_name,
                     **kw)
     return AccountElsewhere.upsert(info)
Пример #4
0
 def make_elsewhere(self, platform, user_id, user_name, **kw):
     """Factory for :py:class:`~gratipay.models.account_elsewhere.AccountElsewhere`.
     """
     info = UserInfo( platform=platform
                    , user_id=unicode(user_id)
                    , user_name=user_name
                    , **kw
                    )
     return AccountElsewhere.upsert(info)
Пример #5
0
 def make_elsewhere(self, platform, user_id, user_name, is_locked=False, **kw):
     info = UserInfo( platform=platform
                    , user_id=unicode(user_id)
                    , user_name=user_name
                    , **kw
                    )
     account = AccountElsewhere.upsert(info)
     if is_locked:
         account.set_is_locked(True)
     return account
Пример #6
0
 def make_elsewhere(self,
                    platform,
                    user_id,
                    user_name,
                    is_locked=False,
                    **kw):
     info = UserInfo(platform=platform,
                     user_id=unicode(user_id),
                     user_name=user_name,
                     **kw)
     account = AccountElsewhere.upsert(info)
     if is_locked:
         account.set_is_locked(True)
     return account
Пример #7
0
 def test_upsert(self):
     for platform in self.platforms:
         user_info = getattr(user_info_examples, platform.name)()
         account = AccountElsewhere.upsert(platform.extract_user_info(user_info))
         assert isinstance(account, AccountElsewhere)
Пример #8
0
 def test_github_get_friends_for(self):
     platform = self.platforms.github
     user_info = platform.extract_user_info(user_info_examples.github())
     account = AccountElsewhere.upsert(user_info)
     friends, nfriends, pages_urls = platform.get_friends_for(account)
     assert nfriends > 0
Пример #9
0
 def test_github_get_friends_for(self):
     platform = self.platforms.github
     user_info = platform.extract_user_info(user_info_examples.github())
     account = AccountElsewhere.upsert(user_info)
     friends, nfriends, pages_urls = platform.get_friends_for(account)
     assert nfriends > 0