Browse Source

[FIX] completely initialize the test model

pull/122/head
Holger Brunn 10 years ago
parent
commit
9b26878f8e
  1. 9
      base_field_serialized/tests/test_serialized.py

9
base_field_serialized/tests/test_serialized.py

@ -31,8 +31,13 @@ class BaseFieldSerializedTestModel(models.Model):
class TestBaseFieldSerialized(TransactionCase): class TestBaseFieldSerialized(TransactionCase):
def test_ReadWrite(self): def test_ReadWrite(self):
BaseFieldSerializedTestModel._build_model(self.registry, self.cr) 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']}) {'serialized': ['hello world']})
self.assertEqual(record.serialized, ['hello world']) self.assertEqual(record.serialized, ['hello world'])
self.env.invalidate_all() self.env.invalidate_all()

Loading…
Cancel
Save