'The transaction level can be configured with
DATABASES [\'OPTIONS\'][\'isolation_level\'].'

def test_connect_isolation_level(self):

    import psycopg2
    from psycopg2.extensions import ISOLATION_LEVEL_READ_COMMITTED as read_committed, ISOLATION_LEVEL_SERIALIZABLE as serializable
    default_level = (read_committed if (psycopg2.__version__ < '2.7') else None)
    self.assertEqual(connection.connection.isolation_level, default_level)
    new_connection = connection.copy()
    new_connection.settings_dict['OPTIONS']['isolation_level'] = serializable
    try:
        new_connection.set_autocommit(False)
        self.assertEqual(new_connection.connection.isolation_level, serializable)
    finally:
        new_connection.close()
