

def test_add_column(self):
    sync_table(FirstModel)
    meta_columns = _get_table_metadata(FirstModel).columns
    self.assertEqual(set(meta_columns), set(FirstModel._columns))
    sync_table(SecondModel)
    meta_columns = _get_table_metadata(FirstModel).columns
    self.assertEqual(set(meta_columns), set(SecondModel._columns))
    sync_table(ThirdModel)
    meta_columns = _get_table_metadata(FirstModel).columns
    self.assertEqual(len(meta_columns), 5)
    self.assertEqual(len(ThirdModel._columns), 4)
    self.assertIn('fourth_key', meta_columns)
    self.assertNotIn('fourth_key', ThirdModel._columns)
    self.assertIn('blah', ThirdModel._columns)
    self.assertIn('blah', meta_columns)
    sync_table(FourthModel)
    meta_columns = _get_table_metadata(FirstModel).columns
    self.assertEqual(len(meta_columns), 5)
    self.assertEqual(len(ThirdModel._columns), 4)
    self.assertIn('fourth_key', meta_columns)
    self.assertNotIn('fourth_key', FourthModel._columns)
    self.assertIn('renamed', FourthModel._columns)
    self.assertNotIn('renamed', meta_columns)
    self.assertIn('blah', meta_columns)

dataset/ETHPy150Open datastax/python-driver/tests/integration/cqlengine/management/test_management.py AddColumnTest.test_add_column/original