[FIX] website_event_sale: need to use new api to send the context. Add some step for test to check if the cart have the distinct products

This commit is contained in:
Christophe Matthieu 2014-09-04 15:30:42 +02:00
parent 068e69c2ed
commit 5064c5b1a5
2 changed files with 16 additions and 3 deletions

View File

@ -41,8 +41,8 @@ class website_event(website_event):
sale = True
ticket_id = key.split("-")[0] == 'ticket' and int(key.split("-")[1]) or None
ticket = ticket_obj.browse(cr, SUPERUSER_ID, ticket_id, context=context)
request.website.sale_get_order(force_create=1)._cart_update(
product_id=ticket.product_id.id, add_qty=quantity, context=dict(context, event_ticket_id=ticket.id))
order = request.website.sale_get_order(force_create=1)
order.with_context(event_ticket_id=ticket.id)._cart_update(product_id=ticket.product_id.id, add_qty=quantity)
if not sale:
return request.redirect("/event/%s" % event_id)

View File

@ -28,9 +28,22 @@
waitFor: 'select:eq(1) option:contains(3):selected',
element: '.btn-primary:contains("Order Now")',
},
{
title: "Check the cart",
element: '#top_menu .my_cart_quantity:contains(5)'
},
{
title: "Check if the cart have 2 order lines and add one VIP ticket",
waitFor: "#cart_products:contains(Standard):contains(VIP)",
element: "#cart_products tr:contains(VIP) .fa-plus",
},
{
title: "Process Checkout",
waitFor: '#top_menu .my_cart_quantity:contains(6)',
element: '.btn-primary:contains("Process Checkout")'
},
{
title: "Complete checkout",
waitFor: '#top_menu .my_cart_quantity:contains(5)',
element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
autoComplete: function (tour) {
if ($("input[name='name']").val() === "")