Assessment Failed

  1. Describe the issue briefly
    getting unit testing error

  2. How much time have you spent debugging this issue?
    Working on it since last 2 hours

there might be some error in your code

sir, I’m unable to detect that

I’m not sir first of all.
tell me exact problem you facing, so that i can help you out

ohh sorry, I’m getting these assessments failed.
tests.test_views.TestSocialSharing

test_post_to_pinterest_share

tests.test_views.TestSocialSharing

test_post_to_facebook_share

tests.test_views.TestSocialSharing

test_post_to_facebook_share_cli

this is my log file
2020-02-03 13:52:58,057 unitTesting INFO Running pytest
2020-02-03 13:53:12,014 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: /tanyatwinkles26-ME_QEATS_REVIEW_MP-76f3a87e-468c-11ea-a96d-e3c69aaa8cc9/tanyatwinkles26-ME_QEATS_REVIEW_MP, inifile: pytest.ini
plugins: django-3.5.1, mock-1.10.4
collected 3 items

tests/test_views.py FFF [100%]

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

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

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 0x3e28bad7ae80>>(‘Assessment completed FACEBOOK CLI module! @ 2020-02-03 13:52:59.691947’, ‘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 0x3e28bad7ae80>> = <tests.test_views.FacebookTestUtil object at 0x3e28bad7ae80>.check_whether_message_is_published

tests/test_views.py:158: AssertionError
----------------------------- Captured stdout call -----------------------------
Assessment completed FACEBOOK CLI module! @ 2020-02-03 13:52:59.691947
200 {‘id’: ‘118436306374188’, ‘post_id’: ‘107666304117855_118436306374188’}
Get user feed url = https://graph.facebook.com/107666304117855/feed?access_token=EAAxMn6lEixcBAHzZBmZCkbQYV6pfnk3LV9yZAc4lVX7pqWIg2aTkkREcc0c0VYEO7ymT5aCrDd8P1Yqjg5JzamevHJKenOzPzZAstHjZCcGYbagGZBJdRbLf7mnXhKlbvqFpeLkZCJPVUzr4x38M2EZCJEHvRsYfOtRQ19QDl82ZANQZDZD&fields=id,message,attachments
________________ TestSocialSharing.test_post_to_facebook_share _________________

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

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 0x3e28b7fd89b0>>(‘Great Work!!! Completed module 1 @ 2020-02-03 13:53:04.727066 #Facebook #Module1’, ‘/tanyatwinkles26-ME_QEATS_REVIEW_MP-76f3a87e-468c-11ea-a96d-e3c69aaa8cc9/tanyatwinkles26-ME_QEATS_REVIEW_MP/tests/sneakpeak.jpg’)
E + where <bound method FacebookTestUtil.check_whether_message_is_published of <tests.test_views.FacebookTestUtil object at 0x3e28b7fd89b0>> = <tests.test_views.FacebookTestUtil object at 0x3e28b7fd89b0>.check_whether_message_is_published

tests/test_views.py:184: AssertionError
----------------------------- Captured stdout call -----------------------------
200 {‘id’: ‘118437013040784’, ‘post_id’: ‘107666304117855_118437013040784’}
Get user feed url = https://graph.facebook.com/107666304117855/feed?access_token=EAAxMn6lEixcBAHzZBmZCkbQYV6pfnk3LV9yZAc4lVX7pqWIg2aTkkREcc0c0VYEO7ymT5aCrDd8P1Yqjg5JzamevHJKenOzPzZAstHjZCcGYbagGZBJdRbLf7mnXhKlbvqFpeLkZCJPVUzr4x38M2EZCJEHvRsYfOtRQ19QDl82ZANQZDZD&fields=id,message,attachments
________________ TestSocialSharing.test_post_to_pinterest_share ________________

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

def test_post_to_pinterest_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)
    import datetime
    message = 'Great Work!!! Completed module 2 @ {}'.format(str(datetime.datetime.now()))
    request_body = {
                    'imgBase64' : img_b64.decode('utf-8'),
                    'text' : message,
                    'orderId' : '0x12312',
                    'tags' : ['Pinterest', 'Module2'],
                    'share' : ['Pinterest']
                    }
    resp = client.post(r'/qeats/v1/review/share', data=request_body, content_type='application/json')
    resp.status_code == 200
    pinterest_test_util = PinterestTestUtil()
    message_expected = message + ' #Pinterest #Module2'
  assert pinterest_test_util.check_whether_message_is_published(message_expected, image_path)

E AssertionError: assert False
E + where False = <bound method PinterestTestUtil.check_whether_message_is_published of <tests.test_views.PinterestTestUtil object at 0x3e28b7f26f98>>(‘Great Work!!! Completed module 2 @ 2020-02-03 13:53:11.453229 #Pinterest #Module2’, ‘/tanyatwinkles26-ME_QEATS_REVIEW_MP-76f3a87e-468c-11ea-a96d-e3c69aaa8cc9/tanyatwinkles26-ME_QEATS_REVIEW_MP/tests/sneakpeak.jpg’)
E + where <bound method PinterestTestUtil.check_whether_message_is_published of <tests.test_views.PinterestTestUtil object at 0x3e28b7f26f98>> = <tests.test_views.PinterestTestUtil object at 0x3e28b7f26f98>.check_whether_message_is_published

tests/test_views.py:210: AssertionError
----------------------------- Captured stdout call -----------------------------

Pinterest API: Looks you have hit the per hour API limit

====================================================================================================
=============================== 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: /tanyatwinkles26-ME_QEATS_REVIEW_MP-76f3a87e-468c-11ea-a96d-e3c69aaa8cc9/tanyatwinkles26-ME_QEATS_REVIEW_MP/tests.xml -
    ======================== 3 failed, 1 warning in 12.54s =========================

2020-02-03 13:53:12,015 unitTesting INFO Pytest run complete
2020-02-03 13:53:12,017 unitTesting INFO Report generated: {‘tests.test_views.TestSocialSharing.test_post_to_pinterest_share’: ‘TEST_STATUS_FAILURE’, ‘tests.test_views.TestSocialSharing.test_post_to_facebook_share’: ‘TEST_STATUS_FAILURE’, ‘tests.test_views.TestSocialSharing.test_post_to_facebook_share_cli’: ‘TEST_STATUS_FAILURE’}

Thats too much error.

  1. Check if you have done everything properly.
  2. Try to find if you have done any silly errors somewhere