test_facebook.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:PythonStudyCode 作者: TongTongX 项目源码 文件源码
def test_fql(self):
        graph = facebook.GraphAPI(version=2.0)
        graph.access_token = graph.get_app_access_token(
            self.app_id, self.secret)

        # Ensure that version is below 2.1. Facebook has stated that FQL is
        # not present in this or future versions of the Graph API.
        if graph.get_version() < 2.1:
            # This is a tautology, but we are limited in what information
            # we can retrieve with a proper OAuth access token.
            fql_result = graph.fql(
                "SELECT app_id from application where app_id = %s" %
                self.app_id)
            self.assertEqual(fql_result["data"][0]["app_id"], str(self.app_id))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号