(self)
| 105 | self.assertEqual(wechat.conf.jsapi_ticket, self.fixtures_jsapi_ticket) |
| 106 | |
| 107 | def test_access_token(self): |
| 108 | # 测试无 appid 和 appsecret 初始化 |
| 109 | wechat = WechatBasic() |
| 110 | with self.assertRaises(NeedParamError): |
| 111 | print(wechat.conf.access_token) |
| 112 | |
| 113 | # 测试有 appid 和 appsecret 初始化 |
| 114 | wechat = WechatBasic(appid=self.appid, appsecret=self.appsecret) |
| 115 | with HTTMock(wechat_api_mock): |
| 116 | access_token = wechat.conf.access_token |
| 117 | self.assertEqual(access_token, self.fixtures_access_token) |
| 118 | |
| 119 | def test_jsapi_ticket(self): |
| 120 | # 测试无 appid 和 appsecret 初始化 |
nothing calls this directly
no test coverage detected