forked from openlp/openlp
Fix reset footer template
This commit is contained in:
parent
8123f9d920
commit
7d71b70d62
@ -269,7 +269,7 @@ class SongsTab(SettingsTab):
|
|||||||
if answer == QtWidgets.QMessageBox.Yes:
|
if answer == QtWidgets.QMessageBox.Yes:
|
||||||
self.settings.setValue('songs/songselect password', self.ccli_password.text())
|
self.settings.setValue('songs/songselect password', self.ccli_password.text())
|
||||||
# Only save footer template if it has been changed. This allows future updates
|
# 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/footer template', self.footer_edit_box.toPlainText())
|
||||||
self.settings.setValue('songs/add songbook slide', self.songbook_slide)
|
self.settings.setValue('songs/add songbook slide', self.songbook_slide)
|
||||||
if self.tab_visited:
|
if self.tab_visited:
|
||||||
|
@ -206,6 +206,20 @@ def test_footer_reset(form):
|
|||||||
assert form.footer_edit_box.toPlainText() == form.settings.get_default_value('songs/footer template')
|
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):
|
def test_save_tab_nochange(form):
|
||||||
"""
|
"""
|
||||||
Test no changes does not trigger post processing
|
Test no changes does not trigger post processing
|
||||||
|
Loading…
Reference in New Issue
Block a user