本文整理汇总了Python中services.verify.decode_receipt函数的典型用法代码示例。如果您正苦于以下问题:Python decode_receipt函数的具体用法?Python decode_receipt怎么用?Python decode_receipt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decode_receipt函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_crack_receipt_new_called
def test_crack_receipt_new_called(self, trunion_verify, settings):
# Check that we can decode our receipt and get a dictionary back.
self.app.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com')
verify.decode_receipt(
'jwt_public_key~' + create_receipt(
self.app, self.user, str(uuid.uuid4())))
assert trunion_verify.called
示例2: test_crack_receipt
def test_crack_receipt(self):
# Check that we can decode our receipt and get a dictionary back.
self.addon.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com')
purchase = self.make_purchase()
receipt = create_receipt(purchase.addon, purchase.user, purchase.uuid)
result = verify.decode_receipt(receipt)
eq_(result['typ'], u'purchase-receipt')
示例3: test_crack_receipt
def test_crack_receipt(self):
# Check that we can decode our receipt and get a dictionary back.
self.app.update(manifest_url="http://a.com")
purchase = self.make_purchase()
receipt = create_receipt(purchase.webapp, purchase.user, purchase.uuid)
result = verify.decode_receipt(receipt)
eq_(result["typ"], u"purchase-receipt")
示例4: test_issue_expired
def test_issue_expired(self):
data = {'receipt_type': 'expired', 'manifest_url': 'http://foo.com/'}
res = self.client.post(self.issue, data=data)
data = decode_receipt(json.loads(res.content)['receipt']
.encode('ascii'))
eq_(data['verify'], absolutify(reverse('receipt.test.verify',
kwargs={'status': 'expired'})))
ok_(data['exp'] > (calendar.timegm(time.gmtime()) +
(60 * 60 * 24) - TEST_LEEWAY))
示例5: test_verify
def test_verify(request, status):
try:
result = decode_receipt(request.body)
# TODO: insert type and url checks here.
if result:
return {'status': status}
except:
log.error('Decoding test receipt', exc_info=True)
return {'status': 'invalid'}
示例6: test_crack_receipt
def test_crack_receipt(self):
# Check that we can decode our receipt and get a dictionary back.
self.addon.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com')
receipt = self.make_install().receipt
result = verify.decode_receipt(receipt)
eq_(result['typ'], u'purchase-receipt')
示例7: test_crack_receipt_new_called
def test_crack_receipt_new_called(self, trunion_verify, settings):
# Check that we can decode our receipt and get a dictionary back.
self.addon.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com')
verify.decode_receipt('.~' + sample)
assert trunion_verify.called
示例8: test_expired_cert
def test_expired_cert(self, mthd):
mthd.side_effect = ExpiredSignatureError
assert 'typ' in verify.decode_receipt('.~' + sample)
示例9: test_expired_cert
def test_expired_cert(self, mthd):
mthd.side_effect = ExpiredSignatureError
assert 'typ' in verify.decode_receipt(
'jwt_public_key~' + create_receipt(
self.app, self.user, str(uuid.uuid4())))
示例10: test_crack_receipt_new_called
def test_crack_receipt_new_called(self, trunion_verify, settings):
# Check that we can decode our receipt and get a dictionary back.
self.app.update(manifest_url="http://a.com")
verify.decode_receipt("jwt_public_key~" + create_receipt(self.app, self.user, str(uuid.uuid4())))
assert trunion_verify.called
示例11: test_crack_receipt
def test_crack_receipt(self):
# Check that we can decode our receipt and get a dictionary back.
self.addon.update(type=amo.ADDON_WEBAPP, manifest_url="http://a.com")
receipt = create_receipt(self.make_install().pk)
result = verify.decode_receipt(receipt)
eq_(result["typ"], u"purchase-receipt")