diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 3105ff1f7..371c3eee5 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -269,7 +269,7 @@ class SongsTab(SettingsTab): if answer == QtWidgets.QMessageBox.Yes: self.settings.setValue('songs/songselect password', self.ccli_password.text()) # Only save footer template if it has been changed. This allows future updates - if self.footer_edit_box.toPlainText() != self.settings.get_default_value('songs/footer template'): + if self.footer_edit_box.toPlainText() != self.settings.value('songs/footer template'): self.settings.setValue('songs/footer template', self.footer_edit_box.toPlainText()) self.settings.setValue('songs/add songbook slide', self.songbook_slide) if self.tab_visited: diff --git a/tests/functional/openlp_plugins/songs/test_songstab.py b/tests/functional/openlp_plugins/songs/test_songstab.py index 34c81e520..cc7fb399d 100644 --- a/tests/functional/openlp_plugins/songs/test_songstab.py +++ b/tests/functional/openlp_plugins/songs/test_songstab.py @@ -206,6 +206,20 @@ def test_footer_reset(form): assert form.footer_edit_box.toPlainText() == form.settings.get_default_value('songs/footer template') +def test_footer_reset_save(form): + """ + Test the footer can be saved as the default value + """ + # GIVEN: A non default footer template and the default template in the edit box + form.settings.setValue('songs/footer template', 'hello') + default_footer = form.settings.get_default_value('songs/footer template') + form.footer_edit_box.setPlainText(default_footer) + # WHEN: save is invoked + form.save() + # THEN: footer template should have been reset to the default_footer value + assert form.settings.value('songs/footer template') == form.settings.get_default_value('songs/footer template') + + def test_save_tab_nochange(form): """ Test no changes does not trigger post processing