From 2ec1ebd07c82361311ca44c7b6cab4ca90f6b7c6 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 30 Jun 2011 16:00:46 +0530 Subject: [PATCH] [IMP] Account_asset: Yml improved bzr revid: mra@mra-laptop-20110630103046-xiocrhjdefoi9lm1 --- addons/account_asset/test/account_asset.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/account_asset/test/account_asset.yml b/addons/account_asset/test/account_asset.yml index 638d55e..fd3f972 100644 --- a/addons/account_asset/test/account_asset.yml +++ b/addons/account_asset/test/account_asset.yml @@ -1,7 +1,7 @@ - - In order to test Account Asset feature first I create Asset Category + In order to test Account Asset I create Asset and confirm it and check it's Depriciation lines - - I Create an Asset Category Record + I Create an Asset Category - !record {model: account.asset.category, id: account_asset_category_landbuildings0}: account_asset_id: account.xfa @@ -10,7 +10,7 @@ journal_id: account.expenses_journal name: Land & Buildings - - I Create an Account Asset Record + I Create an Account Asset - !record {model: account.asset.asset, id: account_asset_asset_Land0}: category_id: account_asset_category_landbuildings0 @@ -19,7 +19,6 @@ partner_id: base.res_partner_14 period_id: account.period_6 purchase_value: 5000.0 - salvage_value: 2000.0 state: draft - I check Initially that Account Asset is in the "Draft" state @@ -32,20 +31,26 @@ !python {model: account.asset.asset}: | self.validate(cr, uid, [ref("account_asset_asset_Land0")]) - - I Compute Account Asset using Compute button and check the number of depreciation lines created are proper + I check Asset is in running state after pressing Confirm button on asset +- + !assert {model: account.asset.asset, id: account_asset_asset_Land0}: + - state == 'open' +- + I Compute Account Asset using Compute button and check the number of depreciation lines created - !python {model: account.asset.asset}: | self.compute_depreciation_board(cr, uid, [ref("account_asset_asset_Land0")]) + # pressing computation button can be remove if creation of depreciation lines while asset is created value = self.browse(cr, uid, [ref("account_asset_asset_Land0")])[0] assert value.method_delay == len(value.depreciation_line_ids) - - I Create Account Asset Move using using create move method + I Create Account Move using create move button on depreciation lines - !python {model: account.asset.depreciation.line}: | ids = self.search(cr, uid, [('asset_id','=',ref('account_asset_asset_Land0'))]) self.create_move(cr, uid, ids) - - I Check that After creating all the moves of the asset the state is in "Close" state + I Check that After creating all the moves of depreciation lines the state is in "Close" state - !assert {model: account.asset.asset, id: account_asset_asset_Land0}: - state == 'close' -- 1.7.10.4