[IMP] Improved YML test cases of Purchase_double_validation module.

bzr revid: tpa@tinyerp.com-20111216072754-s2nwygk3mhp8cvea
This commit is contained in:
Turkesh Patel (Open ERP) 2011-12-16 12:57:54 +05:30
parent 5bd2ce3b12
commit 2c87b0e5f9
3 changed files with 2 additions and 72 deletions

View File

@ -42,8 +42,8 @@ that exceeds minimum amount set by configuration wizard.
'board_purchase_view.xml'
],
'test': [
'test/process/purchase_double_validation_demo.yml',
'test/process/purchase_double_validation_test.yml'
'test/purchase_double_validation_demo.yml',
'test/purchase_double_validation_test.yml'
],
'demo_xml': [],
'installable': True,

View File

@ -1,13 +0,0 @@
-
!record {model: purchase.order, id: order_purchase11}:
partner_id: base.res_partner_desertic_hispafuentes
order_line:
- product_id: product.product_product_pc4
product_qty: 10
-
!record {model: purchase.order, id: order_purchase12}:
partner_id: base.res_partner_vickingdirect0
order_line:
- product_id: product.product_product_hdd2
product_qty: 10

View File

@ -1,57 +0,0 @@
-
I Create new limit amount from Configure Limit Amount for Purchase wizard.
-
!record {model: purchase.double.validation.installer, id: purchase_double_validation_installer_1}:
limit_amount: 3000
-
Then I set the Limit Amount.
-
!python {model: purchase.double.validation.installer}: |
self.execute(cr, uid, [ref("purchase_double_validation_installer_1")])
-
Test for purchase double validation in which Total > = Limit Amount.
-
!python {model: purchase.order}: |
installer_amount = self.pool.get('purchase.double.validation.installer').browse(cr, uid, ref("purchase_double_validation_installer_1"))
purchase_order = self.browse(cr, uid, ref("order_purchase11"))
assert purchase_order.amount_total >= installer_amount.limit_amount ,"Total is Greater then the Limit Amount"
-
In order to test the flow, I confirmed the purchase order.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase11}
-
I check that the order which was initially in the draft state has transmit to confirm state for double validation.
-
!assert {model: purchase.order, id: order_purchase11}:
- state == 'confirmed'
-
I Approved the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: order_purchase11}
-
I check that the order which was initially in the confirmed state has transmit to approved state.
-
!assert {model: purchase.order, id: order_purchase11}:
- state == 'approved'
-
Test for purchase double validation in which Total < = Limit Amount.
-
!python {model: purchase.order}: |
installer_amount = self.pool.get('purchase.double.validation.installer').browse(cr, uid, ref("purchase_double_validation_installer_1"))
purchase_order = self.browse(cr, uid, ref("order_purchase12"))
assert purchase_order.amount_total <= installer_amount.limit_amount ,"Total is Less then the Limit Amount"
-
I confirmed the purchase order.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase12}
-
I Approved the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: order_purchase12}
-
I check that the order has transmit to approved state.
-
!assert {model: purchase.order, id: order_purchase12}:
- state == 'approved'