'Only auto-rollback when autocommit is enabled.'

def test_transaction_ctx_mgr(self):

    def create_error():
        self.assertRaises(IntegrityError, Blog.create)
    with test_db.transaction():
        create_error()
        try:
            create_error()
        except Exception as exc:
            self.assertTrue(isinstance(exc, InternalError))
        else:
            self.assertFalse(issubclass(database_class, PostgresqlDatabase))
    self.test_auto_rollback()
