0
我在Facebook應用上創建了一個測試用戶。如何對Facebook用戶進行單元測試?
如通過郵差在Chrome中我可以輕鬆地使用此URL訪問,並得到一個200響應解釋here
其實我可以訪問測試用戶。
https://graph.facebook.com/v2.1/xxxxxx/accounts/test-users?access_token=yyyyyyy
但是,同樣的網址在我的單元測試中不起作用。我得到一個404爲rv
我可以忽略什麼?
class TestFBConnectAPI(BaseTest):
def __init__(self, *args, **kwargs):
super(TestFBConnectAPI, self).__init__(*args, **kwargs)
def test_connect_signup(self):
app_access_token = facebook.get_app_access_token(app.config['FB_CLIENT_ID'],
app.config['FB_CLIENT_SECRET'])
rv = self.client.post('https://graph.facebook.com/v2.1/{0}/accounts/test-users?access_token={1}'.format(app.config['FB_CLIENT_ID'], app_access_token))
self.assertTrue(rv.status_code, 200)