'Regression for #11900: If a block wrapped by commit_on_success
writes a transaction that can\'t be committed, that transaction should
be rolled back. The bug is only visible using the psycopg2 backend,
though the fix is generally a good idea.'

@skipUnlessDBFeature('requires_rollback_on_dirty_transaction')
def test_bad_sql(self):

    with self.assertRaises(IntegrityError):
        with transaction.commit_on_success():
            cursor = connection.cursor()
            cursor.execute("INSERT    INTO    transactions_reporter    (first_name,    last_name)    VALUES    ('Douglas',    'Adams');")
    transaction.rollback()
