'Regression for #11900: If a function 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):

    execute_bad_sql = transaction.commit_on_success(self.execute_bad_sql)
    self.assertRaises(IntegrityError, execute_bad_sql)
    transaction.rollback()
