当前位置: 首页>>代码示例>>Python>>正文


Python verify.decode_receipt函数代码示例

本文整理汇总了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
开发者ID:anushbmx,项目名称:zamboni,代码行数:7,代码来源:test_verify.py

示例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')
开发者ID:bdacode,项目名称:zamboni,代码行数:7,代码来源:test_verify.py

示例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")
开发者ID:shahbaz17,项目名称:zamboni,代码行数:7,代码来源:test_verify.py

示例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))
开发者ID:JaredKerim-Mozilla,项目名称:zamboni,代码行数:9,代码来源:test_views.py

示例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'}
开发者ID:flyun,项目名称:zamboni,代码行数:9,代码来源:views.py

示例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')
开发者ID:beenishkhan,项目名称:zamboni,代码行数:6,代码来源:test_verify.py

示例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
开发者ID:bdacode,项目名称:zamboni,代码行数:5,代码来源:test_verify.py

示例8: test_expired_cert

 def test_expired_cert(self, mthd):
     mthd.side_effect = ExpiredSignatureError
     assert 'typ' in verify.decode_receipt('.~' + sample)
开发者ID:bdacode,项目名称:zamboni,代码行数:3,代码来源:test_verify.py

示例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())))
开发者ID:anushbmx,项目名称:zamboni,代码行数:5,代码来源:test_verify.py

示例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
开发者ID:shahbaz17,项目名称:zamboni,代码行数:5,代码来源:test_verify.py

示例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")
开发者ID:canuckistani,项目名称:zamboni,代码行数:6,代码来源:test_verify.py


注:本文中的services.verify.decode_receipt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。