問題報錯:TypeError: 'Response' object is not subscriptable
(subscriptable:可下標的)
原因:返回的類型還未轉換為json格式,就進行獲取參數的操作。
解決方案:
rep = auth_SDK_post(url, param)
rep_json = rep.json()
# TODD斷言(6類)
self.assertEqual(str(rep_json['code']),body_resp_code,"body_resp_code")