MCPcopy Create free account
hub / github.com/doraemonext/wechat-python-sdk / test_jsapi_ticket

Method test_jsapi_ticket

tests/test_basic.py:119–129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

117 self.assertEqual(access_token, self.fixtures_access_token)
118
119 def test_jsapi_ticket(self):
120 # 测试无 appid 和 appsecret 初始化
121 wechat = WechatBasic()
122 with self.assertRaises(NeedParamError):
123 print(wechat.conf.jsapi_ticket)
124
125 # 测试有 appid 和 appsecret 初始化
126 wechat = WechatBasic(appid=self.appid, appsecret=self.appsecret)
127 with HTTMock(wechat_api_mock):
128 jsapi_ticket = wechat.conf.jsapi_ticket
129 self.assertEqual(jsapi_ticket, self.fixtures_jsapi_ticket)
130
131 def test_generate_jsapi_signature(self):
132 noncestr = 'Wm3WZYTPz0wzccnW'

Callers

nothing calls this directly

Calls 1

WechatBasicClass · 0.90

Tested by

no test coverage detected