Getting response code 200 but failing assesment in module 2

  1. getting failed test. log file attached

  2. How much time have you spent debugging this issue?
    (Please spend at least 15 minutes to resolve the issue on your own before posting a new topic here)

  3. What is your hypothesis?
    2020-01-25 18:47:44,214 unitTesting INFO Running pytest
    2020-01-25 18:47:54,404 unitTesting INFO ============================= test session starts ==============================
    platform linux – Python 3.6.9, pytest-5.3.1, py-1.8.0, pluggy-0.12.0
    Django settings: qeats.settings (from ini file)
    rootdir: /pawanraip4-ME_QEATS_REVIEW_MP-2864fe46-3fa3-11ea-8684-ab5bc8175981/pawanraip4-ME_QEATS_REVIEW_MP, inifile: pytest.ini
    plugins: django-3.5.1, mock-1.10.4
    collected 2 items

tests/test_views.py FF [100%]

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

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

def test_post_to_facebook_share_cli(self):

    facebook = restaurants.facebook_post.Facebook()
    image_url = 'http://ksmartstatic.sify.com/cmf-1.0.0/appflow/bawarchi.com/Image/oeturjecjjdah_bigger.jpg'
    my_name = self.get_user_name()

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

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

E AssertionError: assert False
E + where False = <bound method FacebookTestUtil.check_whether_message_is_published of <tests.test_views.FacebookTestUtil object at 0x3e909f70b5f8>>(‘Assessment completed FACEBOOK CLI module! @ 2020-01-25 18:47:45.933146’, ‘http://ksmartstatic.sify.com/cmf-1.0.0/appflow/bawarchi.com/Image/oeturjecjjdah_bigger.jpg’)
E + where <bound method FacebookTestUtil.check_whether_message_is_published of <tests.test_views.FacebookTestUtil object at 0x3e909f70b5f8>> = <tests.test_views.FacebookTestUtil object at 0x3e909f70b5f8>.check_whether_message_is_published

tests/test_views.py:119: AssertionError
----------------------------- Captured stdout call -----------------------------
Assessment completed FACEBOOK CLI module! @ 2020-01-25 18:47:45.933146
200 {‘id’: ‘108272020725788’, ‘post_id’: ‘106935460840737_108272020725788’}
Get user feed url = https://graph.facebook.com/106641657555491/feed?access_token=EAAJgjkAaFCQBAECTNkz84xAGqzKeZBhyHPZA111ZCGtNd64DRXZBtvglz8usX0ZCHiABis0d8LZCZCvkY4SeiEEyupb6PKR6VZABoYCO2xfwCyfZAKQz36GH3IeMOKJMY4wLAkhFe58m3SsODgaQsjN6Cd3odZBivpw4yUXLwnRdzFoAZDZD&fields=id,message,attachments
________________ TestSocialSharing.test_post_to_facebook_share _________________

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

def test_post_to_facebook_share(self):
    client = Client()

    prefix = os.getenv('USER_SOLUTION')
    if prefix is None:
        prefix = '.'

    image_path = prefix + '/tests/sneakpeak.jpg'
    img_b64 = restaurants.image_uploader.file_path_to_img64(image_path)
    message = 'Great Work!!! Completed module 1 @ {}'.format(str(datetime.datetime.now()))
    request_body = {
                    'imgBase64' : img_b64.decode('utf-8'),
                    'text' : message,
                    'orderId' : '0x12312',
                    'tags' : ['Facebook', 'Module1'],
                    'share' : ['Facebook']
                    }

    resp = client.post(r'/qeats/v1/review/share', data=request_body, content_type='application/json')
    assert resp.status_code == 200
    facebook_test_util = FacebookTestUtil()
    message_expected = message + ' #Facebook #Module1'
  assert facebook_test_util.check_whether_message_is_published(message_expected, image_path)

E AssertionError: assert False
E + where False = <bound method FacebookTestUtil.check_whether_message_is_published of <tests.test_views.FacebookTestUtil object at 0x3e909a4d1d30>>(‘Great Work!!! Completed module 1 @ 2020-01-25 18:47:49.878584 #Facebook #Module1’, ‘/pawanraip4-ME_QEATS_REVIEW_MP-2864fe46-3fa3-11ea-8684-ab5bc8175981/pawanraip4-ME_QEATS_REVIEW_MP/tests/sneakpeak.jpg’)
E + where <bound method FacebookTestUtil.check_whether_message_is_published of <tests.test_views.FacebookTestUtil object at 0x3e909a4d1d30>> = <tests.test_views.FacebookTestUtil object at 0x3e909a4d1d30>.check_whether_message_is_published

tests/test_views.py:145: AssertionError
----------------------------- Captured stdout call -----------------------------
200 {‘id’: ‘108272064059117’, ‘post_id’: ‘106935460840737_108272064059117’}
Get user feed url = https://graph.facebook.com/106641657555491/feed?access_token=EAAJgjkAaFCQBAECTNkz84xAGqzKeZBhyHPZA111ZCGtNd64DRXZBtvglz8usX0ZCHiABis0d8LZCZCvkY4SeiEEyupb6PKR6VZABoYCO2xfwCyfZAKQz36GH3IeMOKJMY4wLAkhFe58m3SsODgaQsjN6Cd3odZBivpw4yUXLwnRdzFoAZDZD&fields=id,message,attachments
=============================== warnings summary ===============================
/usr/local/lib/python3.6/dist-packages/_pytest/junitxml.py:436
/usr/local/lib/python3.6/dist-packages/_pytest/junitxml.py:436: 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: https://docs.pytest.org/en/latest/warnings.html

  • generated xml file: /pawanraip4-ME_QEATS_REVIEW_MP-2864fe46-3fa3-11ea-8684-ab5bc8175981/pawanraip4-ME_QEATS_REVIEW_MP/tests.xml -
    ========================= 2 failed, 1 warning in 8.63s =========================

2020-01-25 18:47:54,537 unitTesting INFO Pytest run complete
2020-01-25 18:47:54,548 unitTesting INFO Report generated: {‘tests.test_views.TestSocialSharing.test_post_to_facebook_share_cli’: ‘TEST_STATUS_FAILURE’, ‘tests.test_views.TestSocialSharing.test_post_to_facebook_share’: ‘TEST_STATUS_FAILURE’}

You are not following the instructions carefully.
Check the message on the slack #announcement 5:07 PM and make sure you are using the correct URL.
First try sending the request via Postman, if successful then try to analyze the parameters then move to code.
If you have done that then make sure you are passing the correct parameters and passing the parameters in a correct format.