Module 3 Pinterest pins are getting published manually but assessment fails

Please check the error log.
Pin is getting generated.
Still error is coming.
NO API RATE LIMIT PROBLEM.

self = <tests.test_views.PinterestTestUtil object at 0x3e9c291aca20>
message = ‘Great Work!!! Completed module 2 @ 2020-01-26 16:22:30.829597 #Pinterest #Module2
image_path = ‘/goelashwin36-ME_QEATS_REVIEW_MP-0570e692-4058-11ea-8343-b37878374dad/goelashwin36-ME_QEATS_REVIEW_MP/tests/sneakpeak.jpg’

def check_whether_message_is_published(self, message, image_path):

    user_pins = self.get_all_pins_from_board()

    if 'data' not in user_pins:
        print('=' * 100)
        print('\n\n\nPinterest API: Looks you have hit the per hour API limit\n\n\n')
        print('=' * 100)
        return False
  for one_pin in user_pins['data']:

E TypeError: ‘NoneType’ object is not iterable

tests/test_views.py:85: TypeError
----------------------------- Captured stdout call -----------------------------
{‘data’: {‘id’: ‘850124867147891971’, ‘url’: ‘https://www.pinterest.com/pin/850124867147891971/’, ‘link’: ‘’, ‘note’: ‘Great Work!!! Completed module 2 @ 2020-01-26 16:22:30.829597’}}
=============================== warnings summary ===============================

Hey. Just looked at your Unit Testing log file. Seems like you’ve hit the Pinterest API rate limit. Do refer here Pinterest assessment fails due to hitting the API rate limit to solve the same. :slight_smile:

No No. That’s not a rate imit problem for sure. I created a different app and was able to post a pin. Pls check the log in my msg above. A pin is getting generated.


This is the pin generated by system

Hey. In your pinterest_post.py do check your publish function and check if your response URL is right again.

Do refer the Pinterest API docs & make full use of the API explorer.

https://developers.pinterest.com/tools/api-explorer/

It worked.
I was hardcoding the authorization token which wasn’t right.
Thanks

I knew you could do it! You’re a champ! :muscle:

Onto to the next module. :call_me_hand: