當前位置: 首頁>>代碼示例>>Python>>正文


Python Checkout.for_storage方法代碼示例

本文整理匯總了Python中saleor.checkout.core.Checkout.for_storage方法的典型用法代碼示例。如果您正苦於以下問題:Python Checkout.for_storage方法的具體用法?Python Checkout.for_storage怎麽用?Python Checkout.for_storage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在saleor.checkout.core.Checkout的用法示例。


在下文中一共展示了Checkout.for_storage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_index_view

# 需要導入模塊: from saleor.checkout.core import Checkout [as 別名]
# 或者: from saleor.checkout.core.Checkout import for_storage [as 別名]
def test_index_view(cart, status_code, url, rf):
    checkout = Checkout(cart, AnonymousUser(), 'tracking_code')
    request = rf.get('checkout:index')
    request.user = checkout.user
    request.session = {STORAGE_SESSION_KEY: checkout.for_storage()}
    request.discounts = []
    response = views.index_view(request, checkout, checkout.cart)
    assert response.status_code == status_code
    assert response.url == url
開發者ID:fnugrahendi,項目名稱:saleor,代碼行數:11,代碼來源:test_checkout.py

示例2: test_index_view

# 需要導入模塊: from saleor.checkout.core import Checkout [as 別名]
# 或者: from saleor.checkout.core.Checkout import for_storage [as 別名]
def test_index_view(cart, status_code, url, rf, monkeypatch):
    checkout = Checkout(cart, AnonymousUser(), 'tracking_code')
    request = rf.get('checkout:index')
    request.user = checkout.user
    request.session = {STORAGE_SESSION_KEY: checkout.for_storage()}
    request.discounts = []
    monkeypatch.setattr(
        'saleor.cart.utils.get_cart_from_request', lambda req, qs: cart)
    response = views.index_view(request)
    assert response.status_code == status_code
    assert response.url == url
開發者ID:patrys,項目名稱:saleor,代碼行數:13,代碼來源:test_checkout.py

示例3: test_checkout_version

# 需要導入模塊: from saleor.checkout.core import Checkout [as 別名]
# 或者: from saleor.checkout.core.Checkout import for_storage [as 別名]
def test_checkout_version():
    checkout = Checkout(Mock(), AnonymousUser(), 'tracking_code')
    storage = checkout.for_storage()
    assert storage['version'] == Checkout.VERSION
開發者ID:fnugrahendi,項目名稱:saleor,代碼行數:6,代碼來源:test_checkout.py


注:本文中的saleor.checkout.core.Checkout.for_storage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。