• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python test_views_payments.setup_payment_account函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mkt.developers.tests.test_views_payments.setup_payment_account函数的典型用法代码示例。如果您正苦于以下问题:Python setup_payment_account函数的具体用法?Python setup_payment_account怎么用?Python setup_payment_account使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setup_payment_account函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_get_list

    def test_get_list(self, client):
        client.api.bango.package().get.return_value = {"full": payment_data}

        app2 = app_factory(premium_type=amo.ADDON_FREE_INAPP)
        AddonUser.objects.create(addon=app2, user=self.other)
        setup_payment_account(app2, self.other)

        r = self.client.get(list_url('account'))
        eq_(r.status_code, 200)
        data = json.loads(r.content)
        pkg = package_data.copy()
        pkg['resource_uri'] = '/api/v1/payments/account/%s/' % self.account.pk
        eq_(data['objects'], [pkg])
开发者ID:magopian,项目名称:zamboni,代码行数:13,代码来源:test_api.py


示例2: test_only_put_by_owner

 def test_only_put_by_owner(self, client):
     app2 = app_factory(premium_type=amo.ADDON_FREE_INAPP)
     AddonUser.objects.create(addon=app2, user=self.other)
     acct = setup_payment_account(app2, self.other).payment_account
     r = self.client.put(get_url('account', acct.pk),
                         data=json.dumps(package_data))
     eq_(r.status_code, 404)
开发者ID:magopian,项目名称:zamboni,代码行数:7,代码来源:test_api.py


示例3: test_bank_not_required

    def test_bank_not_required(self):
        """When an account is specified, don't require bank details."""
        payment = setup_payment_account(self.app, self.user).payment_account
        form = forms_payments.BangoPaymentAccountForm(self.data, account=payment)
        assert form.is_valid(), form.errors

        del self.data["bankName"]
        form = forms_payments.BangoPaymentAccountForm(self.data, account=payment)
        assert form.is_valid(), form.errors  # Still valid, even now.
开发者ID:gurumukhi,项目名称:zamboni,代码行数:9,代码来源:test_forms_payments.py


示例4: setUp

 def setUp(self):
     BaseOAuth.setUp(self, api_name='payments')
     self.app = Addon.objects.get(pk=337141)
     self.app.update(premium_type=amo.ADDON_FREE_INAPP)
     self.other = UserProfile.objects.get(pk=999)
     AddonUser.objects.create(addon=self.app, user=self.profile)
     self.account = setup_payment_account(self.app, self.profile,
                                          uid='uid2').payment_account
     self.account.name = 'account'
     self.account.save()
开发者ID:magopian,项目名称:zamboni,代码行数:10,代码来源:test_api.py


示例5: test_on_save

    def test_on_save(self):
        """Save should just trigger the account's update function."""
        payment = setup_payment_account(self.app, self.user).payment_account
        form = forms_payments.BangoPaymentAccountForm(self.data, account=payment)
        assert form.is_valid(), form.errors

        form.cleaned_data = {"account_name": "foo", "name": "bob"}
        form.save()

        payment = payment.reload()
        eq_(payment.name, "foo")
        self.bango_patcher.api.by_url.assert_called_with("uid")
开发者ID:gurumukhi,项目名称:zamboni,代码行数:12,代码来源:test_forms_payments.py


示例6: setUp

 def setUp(self):
     super(TestBangoRedirect, self).setUp()
     self.user = UserProfile.objects.get(username='31337')  # steamcube
     self.steamcube = Webapp.objects.get(pk=337141)
     self.otherapp = app_factory(app_slug='otherapp')
     self.reg_user = UserProfile.objects.get(email='[email protected]')
     self.summary_url = reverse('lookup.user_summary', args=[self.user.pk])
     self.login(UserProfile.objects.get(username='support_staff'))
     self.steamcube.update(premium_type=amo.ADDON_PREMIUM)
     self.account = setup_payment_account(self.steamcube, self.user)
     self.portal_url = reverse('lookup.bango_portal_from_package',
         args=[self.account.payment_account.account_id])
     self.authentication_token = u'D0A44686-D4A3-4B2F-9BEB-5E4975E35192'
开发者ID:JaredKerim-Mozilla,项目名称:zamboni,代码行数:13,代码来源:test_views.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.check_upload函数代码示例发布时间:2022-05-27
下一篇:
Python tasks.validator函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap