From 9b26878f8e45e8ac6656dde488c7e8b3daef347e Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 28 Jan 2015 12:48:38 +0100 Subject: [PATCH] [FIX] completely initialize the test model --- base_field_serialized/tests/test_serialized.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/base_field_serialized/tests/test_serialized.py b/base_field_serialized/tests/test_serialized.py index f2956ea96..777fbed8d 100644 --- a/base_field_serialized/tests/test_serialized.py +++ b/base_field_serialized/tests/test_serialized.py @@ -31,8 +31,13 @@ class BaseFieldSerializedTestModel(models.Model): class TestBaseFieldSerialized(TransactionCase): def test_ReadWrite(self): BaseFieldSerializedTestModel._build_model(self.registry, self.cr) - self.env['base.field.serialized.test.model']._auto_init() - record = self.env['base.field.serialized.test.model'].create( + testmodel = self.env['base.field.serialized.test.model'] + testmodel._prepare_setup() + testmodel._setup_base(False) + testmodel._setup_fields() + testmodel._setup_complete() + testmodel._auto_init() + record = testmodel.create( {'serialized': ['hello world']}) self.assertEqual(record.serialized, ['hello world']) self.env.invalidate_all()