-
    In order to test process of the Sale Order with an event product , I create sale order
-
    First I create an event product 
-
    !record {model: product.product, id: event_product}:
         name: test_formation
         type: service
         event_ok: True
         event_type_id: 1
-
    I create an event from the same type than my product
-
    !record {model: event.event,id: event}:
         name: test_event
         event_type_id: 1
         date_end: '2012-01-01 19:05:15'
         date_begin: '2012-01-01 18:05:15'
-
    I create a sale order
-
    !record {model: sale.order, id: order1}:
         partner_id: base.res_partner_2
         note: Invoice after delivery
         payment_term_id: account.account_payment_term
-
    In the sale order I add some sale order lines. i choose event product
-
    !record {model: sale.order.line, id: line}:
         product_id: event_product
         price_unit: 190.50
         product_uom: product.product_uom_unit
         product_uom_qty: 8
         order_id: order1
         name: sale order line
         event_id: event
-
    In the event registration I add some attendee detail lines. i choose event product
-
    !record {model: registration.editor, id: attendee_detail}:
         sale_order_id: order1
         event_registration_ids:
            - event_id: event
              name: 'Administrator'
              email: 'abc@example.com'
-
    I click apply to create attendees
-
    !python {model: registration.editor}: |
         self.action_make_registration(cr, uid, ref('attendee_detail'))
-
    I check if a registration is created
-
    !python {model: event.registration}: |
        from openerp.osv import osv
        from openerp.tools.translate import _
        order_id = ref('order1')
        order =  self.pool.get('sale.order').browse(cr, uid,order_id)
        registration_ids = self.search(cr,uid,[('origin', '=', order.name)])
        if registration_ids == []:
           raise UserError(_("The registration is not created."))
