Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(facebook): :sparkles: add page default picture return. #20

merged 2 commits into from Nov 13, 2019
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now


feat(facebook): add page default picture return.

  • Loading branch information
MerleLiuKun committed Nov 13, 2019
commit 6c8f9ffc983ab01002741456945bbab14b2843c4
@@ -203,6 +203,7 @@ def __init__(self, **kwargs):
'link': None,
'name': None,
'phone': None,
'picture': None,
'rating_count': None,
'single_line_address': None,
'username': None,
@@ -230,9 +231,12 @@ def new_from_json_dict(cls, data, **kwargs):
engagement = data.get('engagement')
if engagement:
engagement = PageEngagement.new_from_json_dict(engagement)
picture = data.get('picture', {}).get('data')
if picture:
picture = PagePicture.new_from_json_dict(picture)
return super(cls, cls).new_from_json_dict(
data=data, category_list=category_list,
cover=cover, engagement=engagement
cover=cover, engagement=engagement, picture=picture

@@ -5,8 +5,8 @@
'id', 'about', 'category', 'category_list', 'checkins', 'cover',
'description', 'description_html', 'display_subtext', 'emails',
'engagement', 'fan_count', 'founded',
'global_brand_root_id', 'link', 'name', 'phone', 'rating_count',
'engagement', 'fan_count', 'founded', 'global_brand_root_id',
'link', 'name', 'phone', 'picture', 'rating_count',
'single_line_address', 'username', 'verification_status', 'website'

@@ -30,7 +30,15 @@
"global_brand_root_id": "1499730620315598",
"link": "",
"name": "Facebook",
"picture": {
"data": {
"height": 50,
"is_silhouette": false,
"url": "",
"width": 50
"username": "facebook",
"verification_status": "blue_verified",
"website": ""
@@ -108,6 +108,7 @@ def testGetPageInfo(self):

page_info_by_name = self.api.get_page_info(username=page_id)
self.assertEqual(, 'Facebook')
self.assertEqual(page_info_by_name.picture.height, 50)

def testGetPostInfo(self):
@@ -48,13 +48,10 @@ def testPage(self):
except Exception as e:

origin_json_data = json.dumps(page_data, sort_keys=True)
self.assertEqual(origin_json_data, page_info.as_json_string())
self.assertEqual(page_data, page_info.as_dict())

self.assertEqual(, '20531316728')
self.assertTrue(isinstance(page_info.category_list, list))
self.assertTrue(isinstance(page_info.cover, pyfacebook.Cover))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.