summaryrefslogtreecommitdiff
path: root/addons/purchase_double_validation
diff options
context:
space:
mode:
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>2011-12-16 12:57:54 +0530
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>2011-12-16 12:57:54 +0530
commit2c87b0e5f91b099f7b39ee2944a67274c8ccd3f4 (patch)
tree2b01d7c6db35099becc32c379c7243fba4b1e50b /addons/purchase_double_validation
parent5bd2ce3b12dd86a94dd05c28df9d7c7bd3fb7492 (diff)
[IMP] Improved YML test cases of Purchase_double_validation module.
bzr revid: tpa@tinyerp.com-20111216072754-s2nwygk3mhp8cvea
Diffstat (limited to 'addons/purchase_double_validation')
-rw-r--r--addons/purchase_double_validation/__openerp__.py4
-rw-r--r--addons/purchase_double_validation/test/process/purchase_double_validation_demo.yml13
-rwxr-xr-xaddons/purchase_double_validation/test/process/purchase_double_validation_test.yml57
3 files changed, 2 insertions, 72 deletions
diff --git a/addons/purchase_double_validation/__openerp__.py b/addons/purchase_double_validation/__openerp__.py
index e0fb45857e5..17c600fb832 100644
--- a/addons/purchase_double_validation/__openerp__.py
+++ b/addons/purchase_double_validation/__openerp__.py
@@ -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,
diff --git a/addons/purchase_double_validation/test/process/purchase_double_validation_demo.yml b/addons/purchase_double_validation/test/process/purchase_double_validation_demo.yml
deleted file mode 100644
index 7c074675b75..00000000000
--- a/addons/purchase_double_validation/test/process/purchase_double_validation_demo.yml
+++ /dev/null
@@ -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
diff --git a/addons/purchase_double_validation/test/process/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/process/purchase_double_validation_test.yml
deleted file mode 100755
index 634c1976ea2..00000000000
--- a/addons/purchase_double_validation/test/process/purchase_double_validation_test.yml
+++ /dev/null
@@ -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'
-
-