'Permission Error may occur when trying to save report.
GH-2147'

def test_save_report(self):

    rep = OWReport.get_instance()
    patch_target_1 = 'Orange.canvas.report.owreport.open'
    patch_target_2 = 'AnyQt.QtWidgets.QFileDialog.getSaveFileName'
    patch_target_3 = 'AnyQt.QtWidgets.QMessageBox.exec_'
    filenames = ['f.report', 'f.html']
    for filename in filenames:
        with unittest.patch(patch_target_1, create=True, side_effect=PermissionError):
            with unittest.patch(patch_target_2, return_value=(filename, 0)):
                with unittest.patch(patch_target_3, return_value=True):
                    rep.save_report()
