[ADD] add test yml

bzr revid: mva@openerp.com-20120210131403-fpd5q1ejgzxff08i
This commit is contained in:
MVA
2012-02-10 14:14:03 +01:00
parent 3cc9d7cb7c
commit 0982e88f2e
+52
View File
@@ -0,0 +1,52 @@
-
In order to test process of the Sale Order, I create sale order
-
create a product
-
!record {model: product.product, id: event_product}:
name: formation
type: service
event_ok: True
event_type_id: 1
default_code: EVT
-
create a sale order
-
!record {model: sale.order, id: order}:
partner_id: base.res_partner_agrolait
note: Invoice after delivery
payment_term: account.account_payment_term
-
create sale order line from the sale order with the product
-
!record {model: sale.order.line, id: line}:
product_id: event_product
price_unit: 190.50
product_uom_qty: 8
order_id: order
name: sale order line
-
confirm the sale order
-
!workflow {model: sale.order, ref: order, action: order_confirm}
-
check if sale order is confirmed
-
!assert {model: sale.order, id: order}:
- state == 'confirmed'
-
check if a registration is created
-
!python {model: event.registration}: |
order_id = ref('order')
order = self.pool.get('sale.order').browse(cr, uid,order_id)
registration_ids = self.search(cr,uid,[('origin','=',order.name)])
if registration_ids == []:
print 'erreur'
else:
if registration_ids[0].state == 'draft':
print 'erreur mauvais state'
-
check registration has been created
check the right type the good person state = draft
-