From 0919bba650c7df37b97bfea623671faf05c6c8da Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 19 Dec 2011 15:24:03 +0530 Subject: [PATCH] [IMP]improvement in YML test cases in purchase and purchase_double_validation module. bzr revid: tpa@tinyerp.com-20111219095403-eaz809x63h114kog --- .../test/process/invoice_on_poline.yml | 4 ++-- .../test/purchase_double_validation_test.yml | 24 ++++--------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/addons/purchase/test/process/invoice_on_poline.yml b/addons/purchase/test/process/invoice_on_poline.yml index 8c61e679cef..22d21fa92ed 100644 --- a/addons/purchase/test/process/invoice_on_poline.yml +++ b/addons/purchase/test/process/invoice_on_poline.yml @@ -1,5 +1,5 @@ - - In order to test the flow, I start it from confirmed purchase order. + I confirm purchase order which has invoicing control method "Based on Purchase Order Lines". - !workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase6} - @@ -19,7 +19,7 @@ for purchase_line in purchase_order.order_line: assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated." - - I create the Default invoicing control method "Based on Purchase Order Lines". + I set the default invoicing control method "Based on Purchase Order Lines". - !python {model: purchase.config.wizard}: | new_id = self.create(cr ,uid, {'default_method': 'manual'}) diff --git a/addons/purchase_double_validation/test/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/purchase_double_validation_test.yml index 25c75242c1b..65578d1e5f4 100755 --- a/addons/purchase_double_validation/test/purchase_double_validation_test.yml +++ b/addons/purchase_double_validation/test/purchase_double_validation_test.yml @@ -1,29 +1,20 @@ - - I Create new limit amount from Configure Limit Amount for Purchase wizard. + I set new limit amount from Configure Limit Amount for Purchase . - !record {model: purchase.double.validation.installer, id: purchase_double_validation_installer_1}: limit_amount: 3000 -- - I set the Limit Amount. - !python {model: purchase.double.validation.installer}: | self.execute(cr, uid, [ref("purchase_double_validation_installer_1")]) -- - I 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 Less 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. + I check that the order which was initially in the draft state has transmit to confirm state for double validation it should not an Approve state. - - !assert {model: purchase.order, id: order_purchase11, severity: error, string: Purchase Order should be in Confirmed state.}: - - state == 'confirmed' + !assert {model: purchase.order, id: order_purchase11, severity: error, string: Purchase Order should not be in Approved state.}: + - state != 'approved' - I Approved the purchase order. - @@ -33,13 +24,6 @@ - !assert {model: purchase.order, id: order_purchase11, severity: error, string: Purchase Order should be in Approved state.}: - 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 Greater then the Limit Amount" - I confirmed the purchase order of amount of less than Limit amount. -