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

Python checkout.CheckoutSelectionView类代码示例

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

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



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

示例1: test_shipping_address_form_post

    def test_shipping_address_form_post(self):
        setattr(self.request, "method", "POST")
        setattr(self.request, "POST", {})

        view = CheckoutSelectionView(request=self.request)
        res = view.get_shipping_address_form()
        self.assertNotEqual(res, None)
开发者ID:ronkhan,项目名称:django-shop,代码行数:7,代码来源:views_checkout.py


示例2: test_billing_address_form_post

    def test_billing_address_form_post(self):
        setattr(self.request, 'method', 'POST')
        setattr(self.request, 'POST', {})

        view = CheckoutSelectionView(request=self.request)
        res = view.get_billing_address_form()
        self.assertNotEqual(res, None)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:7,代码来源:views_checkout.py


示例3: test_get_context_data

 def test_get_context_data(self):
     setattr(self.request, 'method', 'GET')
     view = CheckoutSelectionView(request=self.request)
     ctx = view.get_context_data()
     self.assertNotEqual(ctx, None)
     self.assertNotEqual(ctx['shipping_address'], None)
     self.assertNotEqual(ctx['billing_address'], None)
     self.assertNotEqual(ctx['billing_shipping_form'], None)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:8,代码来源:views_checkout.py


示例4: test_billing_address_form_user_no_preset

 def test_billing_address_form_user_no_preset(self):
     setattr(self.request, 'user', self.user)
     
     address = Address.objects.create(country=self.country, user_billing=self.user)
     address.save()
     
     view = CheckoutSelectionView(request=self.request)
     res = view.get_billing_address_form()
     self.assertEqual(res.instance, address)
开发者ID:KristianOellegaard,项目名称:django-shop,代码行数:9,代码来源:views_checkout.py


示例5: test_billing_address_cache

    def test_billing_address_cache(self):
        setattr(self.request, "method", "POST")
        setattr(self.request, "POST", {})

        view = CheckoutSelectionView(request=self.request)
        res = view.get_billing_address_form()
        self.assertNotEqual(res, None)
        res2 = view.get_billing_address_form()
        self.assertEqual(res, res2)
开发者ID:ronkhan,项目名称:django-shop,代码行数:9,代码来源:views_checkout.py


示例6: test_shipping_address_cache

    def test_shipping_address_cache(self):
        setattr(self.request, 'method', 'POST')
        setattr(self.request, 'POST', {})

        view = CheckoutSelectionView(request=self.request)
        res = view.get_shipping_address_form()
        self.assertNotEqual(res, None)
        res2 = view.get_shipping_address_form()
        self.assertEqual(res, res2)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:9,代码来源:views_checkout.py


示例7: test_order_added_to_session_if_no_user

 def test_order_added_to_session_if_no_user(self):
     """
     Check that the order_id is saved on the session if
     no user is available.
     """
     setattr(self.request, 'user', None)
     self.request.session["cart_id"] = self.cart.pk
     view = CheckoutSelectionView(request=self.request)
     order = view.create_order_object_from_cart()
     self.assertEquals(self.request.session.get("order_id"), order.pk)
     setattr(self.request, 'user', self.user)
开发者ID:evandempsey,项目名称:django-shop,代码行数:11,代码来源:views_checkout.py


示例8: test_processing_signal

    def test_processing_signal(self):
        view = CheckoutSelectionView(request=self.request)

        order_from_signal = []
        def receiver(sender, order=None, **kwargs):
            order_from_signal.append(order)

        processing.connect(receiver)
        res = view.create_order_object_from_cart()

        self.assertIs(res, order_from_signal[0])
开发者ID:albeirochoa,项目名称:django-shop,代码行数:11,代码来源:views_checkout.py


示例9: test_assigning_to_order_from_view_works_with_name_and_address

    def test_assigning_to_order_from_view_works_with_name_and_address(self):
        self.s_add.name = 'toto'
        self.s_add.address2 = 'address2'
        self.s_add.save()
        self.b_add.name = 'toto'
        self.b_add.address2 = 'address2'
        self.b_add.save()

        view = CheckoutSelectionView(request=self.request)
        view.save_addresses_to_order(self.order, self.s_add, self.b_add)
        self.check_order_address()
开发者ID:albeirochoa,项目名称:django-shop,代码行数:11,代码来源:views_checkout.py


示例10: test_orders_are_created_and_cleaned_up

 def test_orders_are_created_and_cleaned_up(self):
     view = CheckoutSelectionView(request=self.request)
     # create a new order with pk 1
     old_order = view.create_order_object_from_cart()
     # create order with pk 2 so sqlite doesn't reuse pk 1
     Order.objects.create()
     # then create a different new order, from a different cart with pk 3
     # order pk 1 should be deleted here
     self.cart.add_product(self.product)
     new_order = view.create_order_object_from_cart()
     self.assertFalse(Order.objects.filter(pk=old_order.pk).exists()) # check it was deleted
     self.assertNotEqual(old_order.order_total, new_order.order_total)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:12,代码来源:views_checkout.py


示例11: test_save_extra_info_to_order

    def test_save_extra_info_to_order(self):
        """
        Check that extra info associated with the order is saved.
        """
        # Set the request to a POST and add data for the form to parse.
        setattr(self.request, 'method', 'POST')
        setattr(self.request, 'POST', {"text": "blah blah"})

        view = CheckoutSelectionView(request=self.request)
        form = view.get_extra_info_form()
        self.assertTrue(form.is_valid())
        order = view.create_order_object_from_cart()
        view.save_extra_info_to_order(order, form)
        self.assertTrue(OrderExtraInfo.objects.filter(order=order).exists())

        # Set the request back to how it was in setUp()
        setattr(self.request, 'method', 'GET')
        del self.request.POST
开发者ID:evandempsey,项目名称:django-shop,代码行数:18,代码来源:views_checkout.py


示例12: test_billing_and_shipping_selection_get

 def test_billing_and_shipping_selection_get(self):
     view = CheckoutSelectionView(request=self.request)
     res = view.get_billing_and_shipping_selection_form()
     self.assertNotEqual(res, None)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:4,代码来源:views_checkout.py


示例13: url

    
    # Cart
    url(r'^cart/delete/$', CartDetails.as_view(action='delete'), # DELETE 
        name='cart_delete'),
    url('^cart/item/$', CartDetails.as_view(action='post'), # POST
        name='cart_item_add' ),
    url(r'^cart/$', CartDetails.as_view(), name='cart'), # GET
    url(r'^cart/update/$', CartDetails.as_view(action='put'), 
        name='cart_update'),

    # CartItems
    url('^cart/item/(?P<id>[0-9A-Za-z-_.//]+)$', CartItemDetail.as_view(),
        name='cart_item' ),
    
    # Checkout
    url(r'^checkout/$', CheckoutSelectionView.as_view(), 
        name='checkout_selection' # First step of the checkout process
        ),
    #url(r'^checkout/ship/$', SelectShippingView.as_view(), 
    #    name='checkout_shipping' # First step of the checkout process
    #    ),
    url(r'^checkout/ship/$', ShippingBackendRedirectView.as_view(), 
        name='checkout_shipping' # First step of the checkout process
        ),
    #url(r'^checkout/pay/$', SelectPaymentView.as_view(), 
    #    name='checkout_payment' # Second step of the checkout process
    #    ),
    url(r'^checkout/pay/$', PaymentBackendRedirectView.as_view(), 
        name='checkout_payment' # First step of the checkout process
        ),
    url(r'^checkout/thank_you/$', ThankYouView.as_view(), 
开发者ID:AlexHill,项目名称:django-shop,代码行数:30,代码来源:urls.py


示例14: test_order_created

 def test_order_created(self):
     view = CheckoutSelectionView(request=self.request)
     res = view.create_order_object_from_cart()
     self.assertEqual(res.order_total, Decimal('0'))
开发者ID:albeirochoa,项目名称:django-shop,代码行数:4,代码来源:views_checkout.py


示例15: import

from django.conf.urls import patterns, url
from shop.util.decorators import cart_required

from shop.views.checkout import (
    CheckoutSelectionView,
    PaymentBackendRedirectView,
    ShippingBackendRedirectView,
    OrderConfirmView,
    ThankYouView,
)

urlpatterns = patterns('',
    url(r'^$', cart_required(CheckoutSelectionView.as_view()),
        name='checkout_selection'  # first step of the checkout process
        ),
    url(r'^ship/$', ShippingBackendRedirectView.as_view(),
        name='checkout_shipping'  # second step of the checkout process
        ),
    url(r'^confirm/$', OrderConfirmView.as_view(),
        name='checkout_confirm'  # third step of the checkout process
        ),
    url(r'^pay/$', PaymentBackendRedirectView.as_view(),
        name='checkout_payment'  # fourth step of the checkout process
        ),
    url(r'^thank_you/$', ThankYouView.as_view(),
        name='thank_you_for_your_order'  # final step of the checkout process
        ),
    )
开发者ID:AirLee,项目名称:django-shop,代码行数:28,代码来源:checkout.py


示例16: test_assigning_to_order_from_view_works

    def test_assigning_to_order_from_view_works(self):
        view = CheckoutSelectionView(request=self.request)
        view.save_addresses_to_order(self.order, self.s_add, self.b_add)

        self.check_order_address()
开发者ID:albeirochoa,项目名称:django-shop,代码行数:5,代码来源:views_checkout.py


示例17: test_billing_address_form_user_preset

 def test_billing_address_form_user_preset(self):
     view = CheckoutSelectionView(request=self.request)
     res = view.get_billing_address_form()
     self.assertNotEqual(res, None)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:4,代码来源:views_checkout.py


示例18: test_billing_and_shipping_selection_cached

 def test_billing_and_shipping_selection_cached(self):
     view = CheckoutSelectionView(request=self.request)
     res = view.get_billing_and_shipping_selection_form()
     res2 = view.get_billing_and_shipping_selection_form()
     self.assertEqual(res, res2)
开发者ID:albeirochoa,项目名称:django-shop,代码行数:5,代码来源:views_checkout.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python product.ProductDetailView类代码示例发布时间:2022-05-27
下一篇:
Python cart.CartDetails类代码示例发布时间: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