-
  I want to organize an event, 
  into this conference I should create two registration.
  One confirmed and attended the event and the other cancelled.

  I create an event
-
  !record {model: event.event, id: event_event}:
   name: event
   date_begin: 2012-01-01 19:05:15
   date_end: 2012-01-01 20:05:15
   register_max: 10
-
  I create a registration for the event
-
  !record {model: event.registration, id: event_registration1}:
   event_id: event_event
   name: test_confirm
   nb_register: 10
-
  I create a second registration for the same event
-
   !record {model: event.registration, id: event_registration2}:
    event_id: event_event
    name: test_cancel
    nb_register: 5
-
  I check if the number of draft registrations in the event view is correct
-
   !assert {model: event.event, id: event_event ,string: 'the number of draft registration is not correct'}:
     - register_prospect == 15.00
-
   I confirm the registration1
-
   !python {model: event.registration}: |
     event_pool = self.pool.get("event.event")
     self.registration_open(cr, uid, [ref("event_registration1")],context=context)
-
   I check that registration is "confirmed"
-
   !assert {model: event.registration, id: event_registration1}:
     - state == 'open', "registration should be confirmed."
-
   I check if the number of confirmed registration is correct
-
   !assert {model: event.event,id: event_event,string: 'the number of confirmed registration is not correct'}:
     - register_current  == 10.00
-
   I close the registration
-
   !python {model: event.registration}: |
     self.button_reg_close(cr, uid, [ref("event_registration1")],context=context)
-
    I check if registration is correctly finnished
-
  !assert {model: event.registration, id: event_registration1}:
      - state == 'done'
-
   I check if attended registration is correct
-
   !assert {model: event.event,id: event_event,string: 'the number of registration that attended the event is not correct'}:
     - register_attended  == 10.00
-
    I cancel the second registration
-
  !python {model: event.registration}: |
    self.button_reg_cancel(cr, uid, [ref("event_registration2")],context=context)
-
    I Check that registration is cancelled
-
  !assert {model: event.registration, id: event_registration2}:
    - state == 'cancel', "Registration should be cancelled."
-
    I confirm the event
-
  !python {model: event.event}: |
    self.button_confirm(cr, uid, [ref("event_event")])
-
     I check that event is in "confirmed" state. 
-
  !assert {model: event.event, id: event_event}:
    - state == 'confirm', "event should be confirmed."
-
     I close the event
-
  !python {model: event.event}: |
    self.button_done(cr, uid, [ref("event_event")])
-
    Check that event is in "close" state. 
-
  !assert {model: event.event, id: event_event}:
    - state == 'done', "Event should be Closed."
-
    I reset event to draft
-
  !python {model: event.event}: |
    self.button_draft(cr, uid, [ref("event_event")])
-
   In order to test the cancellation of the event, I create a second event 
-
  !record {model: event.event, id: event_event1}:
   name: event_cancel
   date_begin: 2012-01-01 19:05:15
   date_end: 2012-01-01 20:05:15
-
  I create a registration for the event
-
  !record {model: event.registration, id: event_registration_cancel}:
   event_id: event_event1
   name: test_confirm_again
   nb_register: 5
-
    Now I cancel this event
-
  !python {model: event.event}: |
    self.button_cancel(cr, uid, [ref("event_event1")])
-
    I check if the event is cancelled
-
  !assert {model: event.event, id: event_event1}:
     - state == 'cancel', "Event should be cancelled."
-
    I check if its registrations are cancelled too
-
  !assert {model: event.registration, id: event_registration_cancel}:
     - state == 'cancel', "Registration should be cancelled."
