<commit_before># -*- coding: utf-8 -*-
from openerp.tests.common import TransactionCase
from openerp.exceptions import except_orm

class test_asset(TransactionCase):

    def setUp(self):
        super(test_asset, self).setUp()
        self.asset = self.env.ref('asset.asset_car')

    def test_unlink(self):
        '''测试删除已审核的固定资产'''
        asset = self.asset.copy()
        self.asset.asset_done()
        with self.assertRaises(except_orm):
            self.asset.unlink()
        # 删除草稿状态的固定资产
        asset.unlink()<commit_msg>[ADD]test asset onchange<commit_after># -*- coding: utf-8 -*-
from openerp.tests.common import TransactionCase
from openerp.exceptions import except_orm

class test_asset(TransactionCase):

    def setUp(self):
        super(test_asset, self).setUp()
        self.asset = self.env.ref('asset.asset_car')

    def test_unlink(self):
        '''测试删除已审核的固定资产'''
        asset = self.asset.copy()
        self.asset.asset_done()
        with self.assertRaises(except_orm):
            self.asset.unlink()
        # 删除草稿状态的固定资产
        asset.unlink()

    def test_onchange(self):
        '''资产相关科目由资产类别带出'''
        self.asset.category_id = self.env.ref('asset.house')
        self.onchange_category_id()
{'fraction_non_alphanumeric': 0.12641815235008103, 'fraction_numerical': 0.0016207455429497568, 'mean_word_length': 2.7537993920972643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2327366', 'n_tokens_mistral': 428, 'n_tokens_neox': 456, 'n_words': 67}