

def test_sync_warnings(self):
    '\n        Test to insure when inconsistent changes are made to a table, or type as part of a sync call that the proper logging messages are surfaced\n\n        @since 3.2\n        @jira_ticket PYTHON-260\n        @expected_result warnings are logged\n\n        @test_category object_mapper\n        '
    mock_handler = MockLoggingHandler()
    logger = logging.getLogger(management.__name__)
    logger.addHandler(mock_handler)
    sync_table(BaseInconsistent)
    sync_table(ChangedInconsistent)
    self.assertTrue(('differing from the model type' in mock_handler.messages.get('warning')[0]))
    if (CASSANDRA_VERSION >= '2.1'):
        sync_type(DEFAULT_KEYSPACE, BaseInconsistentType)
        mock_handler.reset()
        sync_type(DEFAULT_KEYSPACE, ChangedInconsistentType)
        self.assertTrue(('differing from the model user type' in mock_handler.messages.get('warning')[0]))
    logger.removeHandler(mock_handler)

dataset/ETHPy150Open datastax/python-driver/tests/integration/cqlengine/management/test_management.py InconsistentTable.test_sync_warnings/original