Public release from ruodoo-project: 19.0 - 2026-05-31 21:19:12 UTC
This commit is contained in:
22
mklab_base_indicators/tests/test_hg_index_code.py
Normal file
22
mklab_base_indicators/tests/test_hg_index_code.py
Normal file
@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestHgIndexCode(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.code = self.env['hg.index.code'].create({'name': 'Тестовый код'})
|
||||
|
||||
def test_create(self):
|
||||
self.assertEqual(self.code.name, 'Тестовый код')
|
||||
|
||||
def test_index_ids_empty_on_create(self):
|
||||
self.assertFalse(self.code.index_ids)
|
||||
|
||||
def test_index_linked_to_code(self):
|
||||
index = self.env['hg.index'].create({
|
||||
'name': 'Тестовый показатель',
|
||||
'internal_code_id': self.code.id,
|
||||
})
|
||||
self.assertIn(index, self.code.index_ids)
|
||||
Reference in New Issue
Block a user