|
@@ -73,16 +73,16 @@ class EmClassTestCase(unittest.TestCase):
|
73
|
73
|
def test_field_override(self):
|
74
|
74
|
""" Test EmClass field overriding in inheritance """
|
75
|
75
|
cls1 = EmClass('testClass', 'test class')
|
76
|
|
- cls1.new_field('test', data_handler = 'varchar', max_length = 8)
|
|
76
|
+ cls1.new_field('test', data_handler = 'varchar', max_length = 16, nullable=True)
|
77
|
77
|
cls1.new_field('test2', data_handler = 'integer', nullable = True)
|
78
|
78
|
|
79
|
79
|
cls2 = EmClass('testClass2', parents = cls1)
|
80
|
|
- cls2.new_field('test', data_handler = 'varchar', max_length = 16)
|
|
80
|
+ cls2.new_field('test', data_handler = 'varchar', max_length = 16, nullable=False)
|
81
|
81
|
cls2.new_field('test2', data_handler = 'integer', nullable = False)
|
82
|
82
|
|
83
|
83
|
self.assertEqual(len(cls1.fields()), len(cls2.fields()))
|
84
|
|
- self.assertEqual(cls1.fields('test').data_handler_options['max_length'], 8)
|
85
|
|
- self.assertEqual(cls2.fields('test').data_handler_options['max_length'], 16)
|
|
84
|
+ self.assertTrue(cls1.fields('test').data_handler_options['nullable'])
|
|
85
|
+ self.assertFalse(cls2.fields('test').data_handler_options['nullable'])
|
86
|
86
|
|
87
|
87
|
## @todo add more test when data handlers implements compatibility checks
|
88
|
88
|
def test_field_invalid_type_override(self):
|
|
@@ -95,7 +95,6 @@ class EmClassTestCase(unittest.TestCase):
|
95
|
95
|
with self.assertRaises(AttributeError):
|
96
|
96
|
cls2.new_field('test', data_handler = 'integer')
|
97
|
97
|
|
98
|
|
- @unittest.skip("Wait for data handlers to implements a method to check options compatibility")
|
99
|
98
|
def test_field_invalid_options_overrid(self):
|
100
|
99
|
""" Testing invalid fields overriding (incompatible data handler options) """
|
101
|
100
|
cls1 = EmClass('testClass', 'test class')
|