本文整理汇总了Python中shop.util.order.add_order_to_request函数的典型用法代码示例。如果您正苦于以下问题:Python add_order_to_request函数的具体用法?Python add_order_to_request怎么用?Python add_order_to_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_order_to_request函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_06_same_user_does_not_override
def test_06_same_user_does_not_override(self):
self.create_fixtures()
self.order.user = self.user
self.order.save()
setattr(self.request,'user', self.user)
add_order_to_request(self.request, self.order)
self.assertEqual(self.order.user, self.user)
开发者ID:FinalAngel,项目名称:django-shop,代码行数:7,代码来源:order.py
示例2: create_order_object_from_cart
def create_order_object_from_cart(self):
"""
This will create an Order object form the current cart, and will pass
a reference to the Order on either the User object or the session.
"""
cart = get_or_create_cart(self.request)
order = Order.objects.create_from_cart(cart)
request = self.request
add_order_to_request(request, order)
开发者ID:reason-systems,项目名称:django-shop,代码行数:9,代码来源:checkout.py
示例3: create_order_object_from_cart
def create_order_object_from_cart(self):
"""Create an Order object form the current cart.
Pass a reference to the Order on either the User object or the session.
"""
from shop.models import LazyOrder
cart = get_or_create_cart(self.request)
cart.update(self.request)
order = LazyOrder().objects.create_from_cart(cart, self.request)
add_order_to_request(self.request, order)
return order
开发者ID:katomaso,项目名称:django-shop,代码行数:11,代码来源:checkout.py
示例4: test_06_set_order_to_user_works
def test_06_set_order_to_user_works(self):
self.create_fixtures()
setattr(self.request,'user', self.user)
add_order_to_request(self.request, self.order)
self.assertEqual(self.order.user, self.user)
开发者ID:FinalAngel,项目名称:django-shop,代码行数:5,代码来源:order.py
示例5: test_05_set_order_to_session_works
def test_05_set_order_to_session_works(self):
self.create_fixtures()
setattr(self.request,'session', {})
add_order_to_request(self.request, self.order)
self.assertEqual(self.request.session['order_id'], self.order.id)
开发者ID:FinalAngel,项目名称:django-shop,代码行数:5,代码来源:order.py
示例6: test_set_order_to_user_works
def test_set_order_to_user_works(self):
setattr(self.request, 'user', self.user)
add_order_to_request(self.request, self.order)
self.assertEqual(self.order.user, self.user)
开发者ID:bakanov,项目名称:django-shop,代码行数:4,代码来源:order.py
示例7: test_set_order_to_session_works
def test_set_order_to_session_works(self):
setattr(self.request, 'session', {})
add_order_to_request(self.request, self.order)
self.assertEqual(self.request.session['order_id'], self.order.pk)
开发者ID:AirLee,项目名称:django-shop,代码行数:4,代码来源:order.py
示例8: test_same_user_does_not_override
def test_same_user_does_not_override(self):
self.order.user = self.user
self.order.save()
setattr(self.request, "user", self.user)
add_order_to_request(self.request, self.order)
self.assertEqual(self.order.user, self.user)
开发者ID:wmsmith,项目名称:django-shop,代码行数:6,代码来源:order.py
示例9: test_set_order_to_session_works
def test_set_order_to_session_works(self):
setattr(self.request, "session", {})
add_order_to_request(self.request, self.order)
self.assertEqual(self.request.session["order_id"], self.order.id)
开发者ID:wmsmith,项目名称:django-shop,代码行数:4,代码来源:order.py
注:本文中的shop.util.order.add_order_to_request函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论