Getting status code 200 and both id and post id but still failing assessment

please have a look at log files
2020-01-25 11:52:01,751 unitTesting INFO Running pytest
2020-01-25 11:52:14,100 unitTesting INFO ============================= test session starts ==============================
platform linux – Python 3.6.9, pytest-5.3.1, py-1.8.0, pluggy-0.12.0
rootdir: /pawanraip4-ME_QEATS_REVIEW_MP-14753052-3f69-11ea-b236-91959715a45e/pawanraip4-ME_QEATS_REVIEW_MP
plugins: django-3.5.1, mock-1.10.4
collected 1 item

tests/ F [100%]

=================================== FAILURES ===================================
______________ TestSocialSharing.test_post_to_facebook_share_cli _______________

self = <tests.test_views.TestSocialSharing object at 0x3e9a1cc7c4a8>

def test_post_to_facebook_share_cli(self):

    facebook = restaurants.facebook_post.Facebook()
    image_url = ''
    my_name = self.get_user_name()

    message = my_name + ' completed FACEBOOK CLI module! @ {}'.format(str(
    facebook.publish_photo_msg(message, image_url)

    facebook_test_util = FacebookTestUtil()
  assert facebook_test_util.check_whether_message_is_published(message, image_url)


self = <tests.test_views.FacebookTestUtil object at 0x3e9a214b25c0>
message = ‘Assessment completed FACEBOOK CLI module! @ 2020-01-25 11:52:07.488488’
image_path = ‘

def check_whether_message_is_published(self, message, image_path):
    user_feeds = self.get_user_feed()

    if 'error' in user_feeds:
        print("\n\n",json.dumps(user_feed, indent=4))
        return False
    for feed in user_feeds['data']:
        if 'attachments' in feed:
          if feed['message'] == message:

E KeyError: ‘message’

tests/ KeyError
----------------------------- Captured stdout call -----------------------------
Assessment completed FACEBOOK CLI module! @ 2020-01-25 11:52:07.488488
200 {‘id’: ‘110485803834118’, ‘post_id’: ‘112484523614558_110485803834118’}
Get user feed url =,message,attachments
=============================== warnings summary ===============================
/usr/local/lib/python3.6/dist-packages/_pytest/ PytestDeprecationWarning: The ‘junit_family’ default value will change to ‘xunit2’ in pytest 6.0.
Add ‘junit_family=legacy’ to your pytest.ini file to silence this warning and make your suite compatible.
_issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)

– Docs:

  • generated xml file: /pawanraip4-ME_QEATS_REVIEW_MP-14753052-3f69-11ea-b236-91959715a45e/pawanraip4-ME_QEATS_REVIEW_MP/tests.xml -
    ========================= 1 failed, 1 warning in 9.51s =========================

2020-01-25 11:52:14,101 unitTesting INFO Pytest run complete
2020-01-25 11:52:14,103 unitTesting INFO Report generated: {‘tests.test_views.TestSocialSharing.test_post_to_facebook_share_cli’: ‘TEST_STATUS_FAILURE’}

Another qustion similar to this has been posted. Try looking into this

same problem but not able get reason where i am going wrong

I checked. Your request format is not proper. Make sure not to hard code the values. Try referring to this.

i am doing same as given in this link passing message ,image_url, access token only page_id is hardcoded between link